why does my script return an error?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

tallmaris
New php-forum User
New php-forum User
Posts: 5
Joined: Mon Dec 02, 2002 7:26 am
Contact:

Re: why does my script return an error?

Postby tallmaris » Sat Dec 07, 2002 4:20 am

Code: Select all

$result = mysql_query("SELECT url FROM links WHERE id = '$i',$db");


The $db connection must be put as a second argument, and not inside the SQL string, so it should be:

Code: Select all

$result = mysql_query("SELECT url FROM links WHERE id = '$i'" , $db);


Anyway I see you use the "/" to escape special characters (wrong), instead of "\" (right). above all in the last echo:

echo "/">";

that should be echo "\">"; to print the second double quote.

Hope it helps.
Leo.

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests