shwetapandit Posted November 16, 2013 Share Posted November 16, 2013 i got undefined var errors on line no 26,27,28 for variables fname,lname,phone.how they can be undefined they are getting retrived by mysql.how to remove these errors. <?phpsession_start();$host="localhost"; // Host name$username="root"; // Mysql username$password=""; // Mysql password$db_name="regis"; // Database name$tbl_name="regis"; // Table name// Connect to server and select databse.mysql_connect("$host", "$username", "$password")or die("cannot connect");mysql_select_db("$db_name")or die("cannot select DB");if(isset($_SESSION['email']))$email=$_SESSION['email'];{$query="SELECT fname,lname,phone,email FROM regis WHERE email='$email'";$result=mysql_query($query);$num=mysql_fetch_array($result);}?><table width="600" cellpadding="10" cellspacing="0" border="2"><tr align="center" valign="top"><td align="center" colspan="1" rowspan="1"><form action="update.php" method="POST"><input type="hidden" name="email" value="<?php echo "$email"?>"><input type="text" name="fname" value="<?php echo "$fname"?>"><input type="text" name="lname" value="<?php echo "$lname"?>"><input type="text" name="phone" value="<?php echo "$phone"?>"><input type="submit" value="submit"></form></td></tr></table> Quote Link to comment Share on other sites More sharing options...
Solution shwetapandit Posted November 16, 2013 Author Solution Share Posted November 16, 2013 solved Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.