PHP Classes


Recommend this page to a friend!

      Forums Integrator  >  All threads  >  $x->query($sql)  >  (Un) Subscribe thread alerts  
Summary:Tutorial Request:
Author:jim le
Date:2006-09-06 18:04:54
Update:2006-09-07 17:47:30

  1. $x->query($sql)   Reply   Report abuse  
Picture of jim le jim le - 2006-09-06 18:04:54
I found your forum integrator very useful.
I have little experience with php and mysql, so I was wondering if it would be okay for you to write up a quick example of how I would use this function ($x->query($sql)).

Many thanks in advance.

  2. Re: $x->query($sql)   Reply   Report abuse  
Picture of Piotr Malinski Piotr Malinski - 2006-09-07 15:40:47 - In reply to message 1 from jim le
$x->query("SQL CODE HERE") will execute the SQL Query. If it is a SELECT it will return an array with results (array of associative arrays)

$x->query("DELETE FROM mytable");

$query = $x->query("SELECT FROM mytable");
foreach($query as $res)
print $res['columnName'];

  3. Re: $x->query($sql)   Reply   Report abuse  
Picture of jim le jim le - 2006-09-07 17:47:30 - In reply to message 2 from Piotr Malinski
Thank you.