Jump to content

Add value to a variable without forming it before


Marcel1993

Recommended Posts

Hey,

 

$upgrade_next_sql = "SELECT * FROM todo_upgrades WHERE profile_id = ".$profile_id." AND level = ".$profile_data['level_'.$show.'']+1." AND type = '$show'";

 

doesn't work because there is "+1". How can I add this value to the variable without forming a extra variable before?

Also because you are using double quotes theres no need to append the string to insert a variable. You have:

 

"...file_id = ".$profile_id." AND le..."

 

You can made it:

 

"...file_id = $profile_id AND le..." and it will work, However '...file_id = $profile_id AND le...' would not as it's single quotes.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.