PDA

View Full Version : Mysql + Variable + Select Statement ??



Ted S
April 30th, 2001, 00:04
Hello!

I have what will hopefully be a very simple question...

Basically, I need to know if it's possible to modify a variable based on a MySQL select statement.

For example:

if i have

$foo = 10;

can a select statement (SELECT y,z,x ($foo +x) ) be accomplished... that is to say, can I change the variable using part of the select tag?

Basically I am trying to make sure my script only views X bids and since bids can be more than one, I can not just use a LIMIT x,y statement.

Thanks a ton!

lucifer
April 30th, 2001, 09:29
if your select statment is in " " then the variable will get substituted

eg

$result=mysql_db_query($db,"select field from table where field=$value");