Posted By

ginoplusio on 11/11/08


Tagged

mysql db row


Versions (?)

execute row (retrieve one row)


 / Published in: PHP
 

URL: http://www.barattalo.it/

make a query and retrieve the first record, if error occurs show it and the query.

  1. function execute_row($sql) {
  2. $rs = mysql_query($sql) or die(mysql_error().$sql);
  3. if (mysql_num_rows($rs)) {
  4. $r = mysql_fetch_array($rs);
  5. return $r; }
  6. return "";
  7. }

Report this snippet  

You need to login to post a comment.