• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Mysql + Variable + Select Statement ??

Ted S

New Member
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!
 
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");
 
Back
Top