loveallah
11-26-2008, 09:54 PM
peace upon you
hi,
this code with php give me an error
<body bgcolor=blue>
<form action="element.php" method=post>
<?
$connect=mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('phonebook');
$sqlquery = "select * from book";
$result = mysql_query($sqlquery);
$number = mysql_affected_rows();
$i=0;
if($number == 0 )
{
print "<center>No previous orders</center>";
print "<table border=1>
<tr><th></th><th>Name</th><th>Home Number</th><th>Mobile Number</th>
<tr bgcolor=red>
<td align=center><input type="submit" size="5" value="Submit" onClick="fun()"></td>
<td><input type="text" name="name" size="20" maxlength="20"></td>
<td><input type="text" name="home" size="20" maxlength="20"></td>
<td><input type="text" name="mobile" size="20" maxlength="20"></td>
</table>" ;
exit;
}
else
{
print"<center>Add new Person Number</center> <br>";
print"
<table border=1>
<tr><th></th><th>Name</th><th>Home Number</th><th>Mobile Number</th>
<tr bgcolor=red>
<td align=center><input type="submit" size="5" value="Submit" onClick="fun()"></td>
<td><input type="text" name="name" size="20" maxlength="20"></td>
<td><input type="text" name="home" size="20" maxlength="20"></td>
<td><input type="text" name="mobile" size="20" maxlength="20"></td> ";
while($number>$i)
{
$name=mysql_result($result,$i,"Name");
$home=mysql_result($result,$i,"home");
$mobil=mysql_result($result,$i,"mobile");
$i++;
print"<tr><td></td><td>$name</td><td>$home</td><td>$mobil</td>";
}
}
</form>
</body>
it's output is two tables an the php code as it is
what can i do
please any one reply me quickly
hi,
this code with php give me an error
<body bgcolor=blue>
<form action="element.php" method=post>
<?
$connect=mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('phonebook');
$sqlquery = "select * from book";
$result = mysql_query($sqlquery);
$number = mysql_affected_rows();
$i=0;
if($number == 0 )
{
print "<center>No previous orders</center>";
print "<table border=1>
<tr><th></th><th>Name</th><th>Home Number</th><th>Mobile Number</th>
<tr bgcolor=red>
<td align=center><input type="submit" size="5" value="Submit" onClick="fun()"></td>
<td><input type="text" name="name" size="20" maxlength="20"></td>
<td><input type="text" name="home" size="20" maxlength="20"></td>
<td><input type="text" name="mobile" size="20" maxlength="20"></td>
</table>" ;
exit;
}
else
{
print"<center>Add new Person Number</center> <br>";
print"
<table border=1>
<tr><th></th><th>Name</th><th>Home Number</th><th>Mobile Number</th>
<tr bgcolor=red>
<td align=center><input type="submit" size="5" value="Submit" onClick="fun()"></td>
<td><input type="text" name="name" size="20" maxlength="20"></td>
<td><input type="text" name="home" size="20" maxlength="20"></td>
<td><input type="text" name="mobile" size="20" maxlength="20"></td> ";
while($number>$i)
{
$name=mysql_result($result,$i,"Name");
$home=mysql_result($result,$i,"home");
$mobil=mysql_result($result,$i,"mobile");
$i++;
print"<tr><td></td><td>$name</td><td>$home</td><td>$mobil</td>";
}
}
</form>
</body>
it's output is two tables an the php code as it is
what can i do
please any one reply me quickly