开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜