May 2005
Intermediate to advanced
352 pages
14h 39m
English
mysql_query( )
mysql_query(sql_statement[, connection])Use this to execute an SQL statement given. An identifier may be
given as a second argument to query through a different connection.
The function returns false if the query is unsuccessful. For SQL
statements not designed to return a results set (e.g.,
INSERT), true is returned when the function is
successful. Otherwise, a reference to a results set is returned.
...
$sql_stmnt = "SELECT wrid, client_name, description
FROM workreq, clients
WHERE workreq.clientid = clients.clientid";
$results = mysql_query($sql_stmnt, $connection);
while($row = mysql_fetch_row($results)) {
print "WR-$row[0]: $row[1] - $row[2] \n";
}
...Here's one line from the output of this script:
WR-5755: Farber Investments - Can't connect to network.
Read now
Unlock full access