Jump to content

How to display the sql statement contents


geroid

Recommended Posts

Hi

I'm using the following code to insert a record:

 

$insert = mysql_query("insert into $table (event_name, venue_name, streetaddress1, streetaddress2, town, event_description, event_date, event_time) values ('" .$_SESSION['evname']. "', '".$_SESSION['venuename']."', '".$_SESSION['addr1']."',

          '".$_SESSION['addr2']."', '".$_SESSION['town']."', '".$_SESSION['content']."', '".$_SESSION['fulldate']."', '".$_SESSION['time']."',)") or die("Could not insert data because ".mysql_error());?>

 

 

Can anyone tell me how to display the contents of the sql statement on the webpage so I can see that it is correct?

echo $query = "insert into $table (event_name, venue_name, streetaddress1, streetaddress2, town, event_description, event_date, event_time) values ('" .$_SESSION['evname']. "', '".$_SESSION['venuename']."', '".$_SESSION['addr1']."',
          '".$_SESSION['addr2']."', '".$_SESSION['town']."', '".$_SESSION['content']."', '".$_SESSION['fulldate']."', '".$_SESSION['time']."',)";


$insert = mysql_query($query) or die("Could not insert data because ".mysql_error());



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.