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> Link to comment https://forums.phpfreaks.com/topic/283958-undefined-variables/ Share on other sites More sharing options...
shwetapandit Posted November 16, 2013 Author Share Posted November 16, 2013 solved Link to comment https://forums.phpfreaks.com/topic/283958-undefined-variables/#findComment-1458521 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.