Jump to content

Sql Statement not working!


pontypete

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.

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.

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.