note 82457 added to function.mysql-query
| From: | chris at network-13 dot com | Date: | Fri, 11 Apr 2008 17:08:10 +0000 |
| Subject: | note 82457 added to function.mysql-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138187@lists.php.net to get a copy of this message | ||
To massiv at nerdshack dot com,
the code you added to the SQL dump function to remove the ; character from the end of the query
<?php
$query = str_replace(";", "", "$query");
?>
not only removes it from the end but removes all instances of it altogether. I better solution would
be to use this
<?php
$lastchar = substr($query,strlen($query) - 1,strlen($query));
if($lastchar == ";"){
$query = substr($query,0,strlen($query) - 1);
}
?>
----
Server IP: 92.48.100.16
Probable Submitter: 82.17.250.199
----
Manual Page -- http://www.php.net/manual/en/function.mysql-query.php
Edit -- https://master.php.net/note/edit/82457
Del: integrated -- https://master.php.net/note/delete/82457/integrated
Del: useless -- https://master.php.net/note/delete/82457/useless
Del: bad code -- https://master.php.net/note/delete/82457/bad+code
Del: spam -- https://master.php.net/note/delete/82457/spam
Del: non-english -- https://master.php.net/note/delete/82457/non-english
Del: in docs -- https://master.php.net/note/delete/82457/in+docs
Del: other reasons-- https://master.php.net/note/delete/82457
Reject -- https://master.php.net/note/reject/82457
Search -- https://master.php.net/manage/user-notes.php