>
> I guess it is the missing semicolon.
>
>
> And you can write:
>
> echo ""
>
> as simply
>
> echo "$product_type"
>
I prefer
echo '', $product_type, '';
No string concatenation, or variable replacement required.
Jared
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe
Mary-Anne Nayler wrote:
Hi Mark,
As far as I can see the only problem is that you have forgotten to add a
semicolon after the i++
Mark:
Since you are not displaying the counter, you really don't need to
mess with $i.
You can reduce your code to just :
$db = mysql_connect("localhost", "r
On Mon, May 9, 2005 10:57 pm, Mark Sargent said:
> Thanx. I saw the extra echo and removed it. Problem with that code,
> though. It displays only the 1st record, repeatedly, causing the browser
> to hang. Can anyone see what is wrong..? Cheers.
Everybody else has told you to move the $i++; inside
Mary-Anne Nayler wrote:
oh, and the i++ should be inside the while loop and there is also a
missing semi colon after the echo, ie;
$i=0;
while ($i < $num){
$product_type=mysql_result($result,$i,"product_type_detail");
echo "";
$i++ ;
}
Mark Sargent wrote, On 10/05/05 02:23 PM:
Hi All,
this page,
Hi Mark,
As far as I can see the only problem is that you have forgotten to add a
semicolon after the i++
Cheers,
Mary-Anne
Mark Sargent wrote, On 10/05/05 02:23 PM:
Hi All,
this page,
http://www.freewebmasterhelp.com/tutorials/phpmysql/5
has the below code,
$first=mysql_result($result,$i,"fir
quoth the Mark Sargent:
>
>
> Jumbo Status
> $db = mysql_connect("localhost", "root", "grunger");
> mysql_select_db("status",$db);
> $result = mysql_query("SELECT ProductTypes.product_type_detail FROM
> ProductTypes",$db);
> $myrow = mysql_fetch_array($result);
> $num = mysql_num_rows($result);
oh, and the i++ should be inside the while loop and there is also a
missing semi colon after the echo, ie;
$i=0;
while ($i < $num){
$product_type=mysql_result($result,$i,"product_type_detail");
echo "";
$i++ ;
}
Mark Sargent wrote, On 10/05/05 02:23 PM:
Hi All,
this page,
http://www.freewebmaster
Prathaban Mookiah wrote:
I guess it is the missing semicolon.
And you can write:
echo ""
as simply
echo "$product_type"
Prathap
-- Original Message ---
From: Mark Sargent <[EMAIL PROTECTED]>
To: php-general@lists.php.net
Sent: Tue, 10 May 2005 13:23:51 +0900
Subject: [PHP] While and
Mark Sargent <[EMAIL PROTECTED]> writes:
> $i=0;
> while ($i < $num){
> $product_type=mysql_result($result,$i,"product_type_detail");
> echo ""
> }
> $i++
You should put "$i++" into the while loop. And you should add an ";"
at the end of the echo line as well as at the end of "$i++".
With kind r
I guess it is the missing semicolon.
And you can write:
echo ""
as simply
echo "$product_type"
Prathap
-- Original Message ---
From: Mark Sargent <[EMAIL PROTECTED]>
To: php-general@lists.php.net
Sent: Tue, 10 May 2005 13:23:51 +0900
Subject: [PHP] While and echoing HTML
>
10 matches
Mail list logo