mysql_num_fields to PEAR

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Anyone know how to handle the while and for loops with PEAR in the code

// ----------------------------------------------------------------

$result = mysql_query("SELECT bus_price FROM cf where name='$name'",

while ($row = mysql_fetch_row($result)) {
    for ($i = 0; $i < mysql_num_fields($result); $i++) {

Hunt down instances of newline breaks and text spaces in blob field of
database and replace with HTML linebreak and HTML spaces...

$replace = str_replace(" ", "&nbsp;", $row[$i]);
$replace = nl2br($replace);

"<font face = \"arial, helvetica, sans-serif\" size =\"2\">
<br>" . $replace . " ";


// ----------------------------------------------------------------

Re: mysql_num_fields to PEAR

juray wrote:
Quoted text here. Click to load it

   How about the same was as presented in the documentation for PEAR::DB


Site Timeline