sql and php autoincrese

i have started this script and im useing one databace all as going well intill i wanted to add the second line to the databace and i couldnt get it to read the secend line could some one help me plz here is the two parts of my script

config.php

[code]<?
$username=“xxxxxxxx”;
$password=“xxxxxx”;
$database=“xxxxxxxx”;

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( “Unable to select database”);
$query=“SELECT * FROM hubs”;
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

$i=0;
while ($i < $num) {

$hub=mysql_result($result,$i,“hub”);
$hubname=mysql_result($result,$i,“hubname”);
$address=mysql_result($result,$i,“address”);
$port=mysql_result($result,$i,“port”);
$owner=mysql_result($result,$i,“owner”);

$i++;
}

?>

<?php $hub = @fsockopen("$address","$port", $errno, $errstr, 2); if($hub) { $hub1=true; } else { $hub=false; } ?> <?php $hub1 = @fsockopen("$address", "$port", $errno, $errstr, 2); if($hub1) { $hub1=true; } else { $hub1=false; } ?>[/code]

and this is hub.php

[code]

<?php include "inc/config.php" ?>
Name:
<?php $hubname ?>
DNS:
<?php $hubaddress?>
Owner:
<?php $owner ?>
Stats:
<?php if($hub) { ?> Online <?php } else { ?> Offline<?php } ?>

Name:
<?php $hubname ?>
DNS:
<?php $hubaddress ?>
Owner:
<?php $owner ?>
Stats:
<?php if($hub1) { ?> Online <?php } else { ?> Offline<?php } ?>
[/code]

can some one help me plz

thanks in advance

I believe that your $num initialization is incorrect. It’s mysql_num_rows not mysql_numrows.

Sponsor our Newsletter | Privacy Policy | Terms of Service