Jump to content

[SOLVED] String and integer? help wanted....


Johan Beijar

Recommended Posts

Dear all,

 

I have the following code and I get an errormsg because of it...

 

$sql = "SELECT * FROM pictures WHERE username = '$username' AND parent_album = '.$album['album_id']'";

 

I get the following errormsg:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in

 

I think there is a problem with ' or " or .

 

I appriciate any help!

 

Thank you,

 

//Johan Beijar

Link to comment
https://forums.phpfreaks.com/topic/153150-solved-string-and-integer-help-wanted/
Share on other sites

Your SQL statement is not formed correctly.

 

$sql = "SELECT * FROM pictures WHERE username = '".$username."' AND parent_album = '".$album['album_id']."'";

 

 

If you're string starts with a ", you should open and close it at all times with ".

 

 

Edit: This might not be the main problem, come back to us if it isn't

 

 

 

 

ILMV

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.