Jump to content

Sql Statement not working!


pontypete
 Share

Recommended Posts

Your statement is not going to work. It will put inside the database '$thisvariable'. But even then, it wont do that and return an error.

 

Your Statement:

$query_rsGetOrderDetails = "SELECT * FROM hd_order WHERE order_by = '$usernameLoggedin' ORDER BY order_id DESC LIMIT 3"

Fixed Statement
$query_rsGetOrderDetails = "SELECT * FROM hd_order WHERE order_by = '{$usernameLoggedin}' ORDER BY order_id DESC LIMIT 3"

 

However as SergeiSS said, you have to use the mysql_query function for it to run.

Link to comment
Share on other sites

Your statement is not going to work. It will put inside the database '$thisvariable'. But even then, it wont do that and return an error.

 

Your Statement:

$query_rsGetOrderDetails = "SELECT * FROM hd_order WHERE order_by = '$usernameLoggedin' ORDER BY order_id DESC LIMIT 3"

Fixed Statement
$query_rsGetOrderDetails = "SELECT * FROM hd_order WHERE order_by = '{$usernameLoggedin}' ORDER BY order_id DESC LIMIT 3"

 

However as SergeiSS said, you have to use the mysql_query function for it to run.

 

There is nothing syntactically wrong with the query string the way the OP has it written. The curly braces aren't needed.

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.