Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

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