note 75391 added to function.mysql-fetch-assoc

From: Date: Sun, 27 May 2007 03:18:31 +0000
Subject: note 75391 added to function.mysql-fetch-assoc
Groups: php.notes 
Request: Send a blank email to php-notes+get-126940@lists.php.net to get a copy of this message
"Adding alias names in MySQL isn't easy, because you can't ask for SELECT table1.otherfield AS table1otherfield, * FROM table1 LEFT JOIN table2 ON table1.somefield=table2.somefield You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM table1 LEFT JOIN table2 ON table1.somefield=table2.somefield" Why not fix your SQL instead of writing some pointless function? SELECT table1.otherfield AS table1otherfield, table1.*, table2.* FROM table1 LEFT JOIN table2 ON table1.somefield=table2.somefield; ---- Server IP: 83.137.20.120 Probable Submitter: 85.17.40.99 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-fetch-assoc.php Edit -- https://master.php.net/note/edit/75391 Del: integrated -- https://master.php.net/note/delete/75391/integrated Del: useless -- https://master.php.net/note/delete/75391/useless Del: bad code -- https://master.php.net/note/delete/75391/bad+code Del: spam -- https://master.php.net/note/delete/75391/spam Del: non-english -- https://master.php.net/note/delete/75391/non-english Del: in docs -- https://master.php.net/note/delete/75391/in+docs Del: other reasons-- https://master.php.net/note/delete/75391 Reject -- https://master.php.net/note/reject/75391 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#126940) next »