Re: PHP syntax

From: Date: Thu, 01 May 2003 15:17:11 +0000
Subject: Re: PHP syntax
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-145968@lists.php.net to get a copy of this message
I would like to thank everybody that helped me with this issue....Here is the end result! echo "<table>"; //echo "<br><br><br><br><br>"; echo '<tr valign=top>'; for($i = 0; $i < $numofrows; $i++) { $row = mysql_fetch_array($result); //get a row from our result set echo "<TD width=950 height=93><font face=**** size=3><center>*" .str_replace(' ','_',$row['blah']) ."*<br>*" .str_replace(' ','_',$row['blah']) ."*<br>*" .str_replace(' ','_',$row['blah']) ."*</TD>\n"; //make new row after every 3rd item if (($i+1)%3==0) echo "</TR>\n<tr valign=top>"; } echo '</tr>'; echo "</table>"; Once again thanks!!! "John W. Holmes" <holmes072000@charter.net> wrote in message news:005c01c30fe0$a62cf140$7c02a8c0@coconut... > > What I would like to do is use what Luke or Burhan gave me to try as > far > > as > > replacing the spaces with an underscore, but I am having a hard time > > placing > > the variable for me to manipulate! > > > > <?PHP > > include 'drop.php'; > > $DBName = "******"; > > $table = "*****"; > > $db = mysql_connect("$DBhost","$DBuser","$DBpass") or > > die("Problem > > connecting"); > > mysql_select_db("$DBName") or die("Problem selecting database"); > > $query = "SELECT * FROM $table"; > > $result = mysql_query($query) or die ("Query failed"); > > //let's get the number of rows in our result so we can use it in a for > > loop > > $numofrows = mysql_num_rows($result); > > ?> > > > > <?PHP > > echo "<body>"; > > echo "<TABLE align=left BORDER=\"1\">\n"; > > echo "<TR width=75%<TD WIDTH=150><font > > size=2><center><b>BLDG ROOM > > CABINET</b></center></TD>\n"; > > for($i = 0; $i < $numofrows; $i++) { > > $row = mysql_fetch_array($result); //get a row from our result set > > > > //$Bldgroomcabpost = ".$row['Bldgroomcab']."; > > //$Bldgroomcabspace = str_replace(" ", "_", $Bldgroomcabpost); > > echo "<TD><font size=3 > > > > face=********><center>".$row['Bldgroomcab']."</TD>\n"; > > echo "<TD><font size=3 > face=********><center>".str_replace(" > ","_",$row['Bldgroomcab'])."</TD>\n"; > > ---John Holmes... > >

« previous php.general (#145968) next »