Jump to content

Multi-Line Queries....


drbigfresh

Recommended Posts

Is there anyway to make something like this work:

 

$SQL = $SQL . "delete from e_user where id=" . $DeleteID . "\n";

$SQL = $SQL .  "delete from upload where uid=" . $DeleteID . "\n";

$SQL = $SQL . "delete from e_workexperience where uid=" . $DeleteID . "\n";

$SQL = $SQL .  "delete from e_schooling where uid=" . $DeleteID . "\n";

$SQL = $SQL . "delete from e_notes where uid=" . $DeleteID . "\n";

$SQL = $SQL . "delete from e_miscuserdata where uid=" . $DeleteID . "\n";

$SQL = $SQL . "delete from e_industryexperiencemap where uid=" . $DeleteID . "\n";

 

$db->Execute($SQL) or die("Error in query: $query. " . $db->ErrorMsg());

 

Link to comment
https://forums.phpfreaks.com/topic/75143-multi-line-queries/
Share on other sites

Aren't I making a really long query separated by new lines since it's $SQL  = $SQL . "" ?

 

Queries are seperated by colons ; in sql. Having said that however, the mysql extension does not support the execution of multiple queries (seperated by ; for security reasons. You will need to place all your queries within an array, loop through the array and execute each query.

Link to comment
https://forums.phpfreaks.com/topic/75143-multi-line-queries/#findComment-380087
Share on other sites

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.