Store value from SELECT statement into variable
How can i store the value from a SELECT MySQL statement into a PHP variable? for example:
$myvariable = SELECT * FROM X WHERE 开发者_如何转开发id = X
Thanks
you need to look at the php manual for the mysql/mysqli wrapper functions.
http://us3.php.net/manual/en/book.mysql.php
http://us3.php.net/manual/en/book.mysqli.php
If the code you provided was written with proper syntax (you need single/double quotes around string literals in php) your variable would contain the sql query string. You need to send that to the database via some kind of wrapper.
You may wont to search around for some general php and php/mysql tutorials.
精彩评论