# Problem creating Reports / Updatable .php files

**URL:** https://forum.kirupa.com/t/problem-creating-reports-updatable-php-files/323819
**Category:** programming
**Created:** [July 20, 2011, 3:16am UTC](https://forum.kirupa.com/t/problem-creating-reports-updatable-php-files/323819 "2011-07-20T03:16:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![AKirchy](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@AKirchy](https://forum.kirupa.com/u/AKirchy)
#### Post date: [July 20, 2011, 3:16am UTC](https://forum.kirupa.com/t/problem-creating-reports-updatable-php-files/323819/1 "2011-07-20T03:16:11Z")

</div>

i know that the problem is something very minor, but im relatively new to PHP/mySQL. im pretty proficient with HTML and much older coding languages, im talking C Basic and C+, and some Cobalt. anyways here is the code for my update.php, im getting an error on line 7, here is the error verbatim:

here is the code im using (this is just trying to get it to work, i am going to expand but no point if i can’t get my basic connections to work, building a ADD/LIST ALL with buttons on each entry for EDIT/UPDATE, but as i said cant even get basic stuff to work, i know it something minor. in the book i read it said to use mysql\_numrows() but in dreamweaver it only recognizes mysql\_num\_rows() not sure which is wrong, help please both fail on live test!):

\<?  
include(“dbinfo.inc.php”);  
mysql\_connect($host,$username,$password);  
mysql\_select\_db($database) or die( “Unable to select database”);  
$query=“SELECT \* FROM users 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”);  
$email=mysql\_result($result,$i,“email”);  
?\>  
\<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\>  
E-mail Address: \<input type=“text” name=“ud\_email” value="\<? echo “$email”?\>"\>\<br\>  
\<input type=“Submit” value=“Update”\>  
\</form\>  
\<?  
++$i;  
}  
?\>

any and all help much appreciated, if someone doesnt mind PMs or prefers posting live, i will have a few more questions as i finish this project. thanks in advance from an old code monkey trying to catch up.🍺

P.S. i doubt you need it, but im new so i will add my ‘updated.php’ script below as well since its included above, though my error hits on line 7 (the mysql\_nom\_row($result) line):

\<?  
include(“dbinfo.inc.php”);  
mysql\_connect($host,$username,$password);  
$query=“UPDATE users SET first=’$ud\_first’, last=’$ud\_last’, phone=’$ud\_phone’, email=’$ud\_email’ WHERE id=’$ud\_id’”;  
mysql\_select\_db($database) or die( “Unable to select database”);  
mysql\_query($query);  
echo “Record Updated”;  
mysql\_close();  
?\>
