Doc #54921 [Opn->Bgs]: Omit the extra line.

From: Date: Thu, 08 Dec 2011 00:59:44 +0000
Subject: Doc #54921 [Opn->Bgs]: Omit the extra line.
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7622@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54921&edit=1 ID: 54921 Updated by: philip@php.net Reported by: bimal at sanjaal dot com Summary: Omit the extra line. -Status: Open +Status: Bogus Type: Documentation Problem Package: Documentation problem Operating System: Windows PHP Version: 5.3.6 Block user comment: N Private report: N New Comment: It has been determined that this is not be a bug. Previous Comments: ------------------------------------------------------------------------ [2011-09-28 10:06:39] a at b dot c dot de The semicolon in SQL is a statement *separator*, not a statement *terminator* (as it is in PHP). Putting a semicolon at the end of a query effectively means you are making two queries - the second one empty. ------------------------------------------------------------------------ [2011-05-26 15:00:58] johannes@php.net A "should" is something else from a "must not." This might fail depending on MySQL server and client lib versions and configuration. You should not rely on it. ------------------------------------------------------------------------ [2011-05-25 06:51:39] bimal at sanjaal dot com Description: ------------ --- From manual page: http://www.php.net/function.mysql-query#Parameters --- The following is not true: The query string should not end with a semicolon. Please correct the documentation. It works even with or without the ending semicolon. We can run the query that end with semicolons. PHP should not try to complete the queries itself with the semicolon. Test script: --------------- <?php error_reporting(E_ALL|E_STRICT); mysql_connect('localhost', 'root', 'toor'); mysql_select_db('test'); $rs = mysql_query('SELECT NOW() time;'); # Query with semicolon at the end $current = mysql_fetch_assoc($rs); echo $current['time']; ?> Expected result: ---------------- Query with semicolon works well. Actual result: -------------- none ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=54921&edit=1

« previous php.doc.bugs (#7622) next »