Hi guys,
I have been doing a contact list tutorial for php and mysql. I already use php on my site but I was excited to get more into MySQL (which is really awesome btw).
So I have created the page to add a contact:
http://www.fluidvision.net/php/connect.html
a place to see the added contacts:
http://www.fluidvision.net/php/pull.php
and now I am working on a way to update them,
http://www.fluidvision.net/php/update.php
you notice it displays nothing, that's the problem.
check page 7 of that tutorial up above to see what I am trying to do.
My problem is, I can't see the html of my update form inside the update.php file.
Let me show you:
The html for my form can't be seen by the browser. And I have even uploaded the guys official tutorial script
http://www.fluidvision.net/php/official/update.php
and his can't be seen either.
So, my question is, how can I get my update form to work?
Any help is SOOO greatly appreciated.
I have been doing a contact list tutorial for php and mysql. I already use php on my site but I was excited to get more into MySQL (which is really awesome btw).
So I have created the page to add a contact:
http://www.fluidvision.net/php/connect.html
a place to see the added contacts:
http://www.fluidvision.net/php/pull.php
and now I am working on a way to update them,
http://www.fluidvision.net/php/update.php
you notice it displays nothing, that's the problem.
check page 7 of that tutorial up above to see what I am trying to do.
My problem is, I can't see the html of my update form inside the update.php file.
Let me show you:
PHP:
<?
$username="-----";
$password="-----";
$database="---------";
mysql_connect("127.0.0.1",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query=" SELECT * FROM contacts WHERE id='$id'";
$result=mysql_query($query);
$num=mysql_num_rows($result);
mysql_close();
$i=0;
while ($i < $num) {
$first=mysql_result($result,$i,"first");
$last=mysql_result($result,$i,"last");
$phone=mysql_result($result,$i,"phone");
$mobile=mysql_result($result,$i,"mobile");
$fax=mysql_result($result,$i,"fax");
$email=mysql_result($result,$i,"email");
$web=mysql_result($result,$i,"web");
?>
<form action="updated.php">
<input type="hidden" name="ud_id" value="<? echo "$id"; ?>">
First Name: <input type="text" name="ud_first" value="<? echo "$first"?>"><br>
Last Name: <input type="text" name="ud_last" value="<? echo "$last"?>"><br>
Phone Number: <input type="text" name="ud_phone" value="<? echo "$phone"?>"><br>
Mobile Number: <input type="text" name="ud_mobile" value="<? echo "$mobile"?>"><br>
Fax Number: <input type="text" name="ud_fax" value="<? echo "$fax"?>"><br>
E-mail Address: <input type="text" name="ud_email" value="<? echo "$email"?>"><br>
Web Address: <input type="text" name="ud_web" value="<? echo "$web"?>"><br>
<input type="Submit" value="Update">
</form>
<?
++$i;
}
?>
The html for my form can't be seen by the browser. And I have even uploaded the guys official tutorial script
http://www.fluidvision.net/php/official/update.php
and his can't be seen either.
So, my question is, how can I get my update form to work?
Any help is SOOO greatly appreciated.