Re: Am I asking too much?
| From: | John Taylor-Johnston | Date: | Sat, 11 Oct 2003 14:39:43 +0000 |
| Subject: | Re: Am I asking too much? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165849@lists.php.net to get a copy of this message | ||
Any ideas? I want to avoid having two "mysql_query($sql)". I'm basically looking for
better functionality and wanting to learn how to clean up my code.
John Taylor-Johnston wrote:
> So I should break it up my two queries?
>
> $sql = 'insert into '.$db2.'.'.$table2.'(KW,AUS,GEO,AN,RB,CO,RR)
> select KW,AUS,GEO,AN,RB,CO,RR FROM '.$db.'.'.$table.'
> WHERE id='.$id.';';
>
> mysql_query($sql);
>
> $sql = 'DELETE FROM '.$db.'.'.$table.' WHERE id='.$id.'
> LIMIT 1;';
> mysql_query($sql);
>
> Any suggestions how I could prompt in between to ask yes or no? PhpMyAdmin does it with a
> javascript alert(). An easy answer? Maybe I'm being lazy?
>
> > For security reasons mysql_query does not support ; to separate queries.
> > phpmyadmin splits multiple query strings up (PMA_splitSqlFile())