Re: [PHP] Order by

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




start the quotes again...

$specs_query = mysql_query("select title, information from spec where
product=".$id." order by id asc");



Why do you split the string?

When all you need to do is

$specs_query = mysql_query("select title, information from spec where

product = $id order by id asc");

because your using " and not ' it will fill the varible in for you.

If it was a string and you need to surround the string then it would be

$specs_query = mysql_query("select title, information from spec where

product = '{$id}' order by id asc");

That would fill the variable in and the single quotes required for sql.

Regards,




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux