English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Can anyone help me with this code? I get the following error:

"
SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

SELECT username, email, user_viewemail, user_lang FROM dir_editors WHERE id =

Line : 213
File : usercp_email.php"

I can't figure out where this error is my code, all I've changed in the code is the location of the mysql table. I can't post the fill code as it's too long, any ideas would be more than welcome..

2007-03-24 12:32:06 · 4 answers · asked by orchie1 2 in Computers & Internet Programming & Design

4 answers

Not being too up on BB coding, this SQL statement is trying to pull the username, email (possibly address?), user_viewemail and user language from a table in a MySQL database table called dir_editors, which is likely to be a list of people who can send, view or edit emails or posts.

Now the problem is it's looking up one person in particular, which is referenced by the id number. Problem is the id number is missing from this code.

Now, you say you've moved the MySQL table. It might be that the new location of the table is unknown and as such the database no longer likes it. Try moving the table back, and if that fixes the problem, you may need to move it and create a view to reference the new location but in the old place... Or update links to the new location.

If you move it back and it still causes trouble, it could well be you accidentally changed some code for the worse by deleting a few letters elsewhere.....

2007-03-24 12:43:57 · answer #1 · answered by quickhare_uk 3 · 0 0

You don't say how you changed the location of the table, but I would suggest you insert 2 lines above this code :-
echo $whatever-variable-holds-the-id;
exit;
This will tell you if the query is receiving the right data. Also, for any variable-held number in a query, you should enclose the variable in quotes, as an empty variable will otherwise be interpreted as a gap in the query, and thus an error.

2007-03-24 19:56:34 · answer #2 · answered by Anonymous · 0 0

It seems like no value for id variable sent to sql query try to echo the sql before sending it to server and you found the problem.
Type
echo "SQL: $sql";
then
mysql_query($sql);

2007-03-25 16:16:03 · answer #3 · answered by Mukhtar 1 · 0 0

try re-registering again and save under a new account with new pass word if that doesn't work then try system restore

to get system restore: go to start menu, 1)all programs,
2)accessories, then 3)system tools, and 4)system restore at bottom of third pop up menu

Once system restore is set to an earlier time wait for re-boot this will restore all defaults and will take approx 10mins ....

2007-03-26 03:33:11 · answer #4 · answered by raymondtwist 2 · 0 0

fedest.com, questions and answers