Current location: Hot Scripts Forums » Programming Languages » PHP » undefined variable


undefined variable

Reply
  #1 (permalink)  
Old 10-27-11, 01:57 PM
ufone ufone is offline
New Member
 
Join Date: Oct 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
undefined variable

where is mistake ?
<?php

/**
* @author MESMERiZE
* @copyright 2011
*/

//connection file
include "connection.php";
$query ="select * from resultweb";
$q_result=mysql_query($query,$link) or die(mysql_error());
if(mysql_num_rows($q_result)<=0){
die("No record found");

}

//htaml table starts
Print "<table border=1><tr>
<th>name</th>
<th>student name</th>
<th>name</th></tr>";
while($Row = mysql_fetch_assoc($q_result)){
print "<tr><td>".$Row['name'] ."</td>
<td>" .$row['code'] ."</td>
<td>" .$row['name'] ."</td></tr>";

}
print "</table>";
?>
Reply With Quote
  #2 (permalink)  
Old 10-28-11, 05:15 AM
phplabs phplabs is offline
Newbie Coder
 
Join Date: Oct 2011
Posts: 37
Thanks: 0
Thanked 7 Times in 7 Posts
what is the error message?

perhaps the problem is that you have $Row in one place and $row in another. you should not change the case of variable names.
__________________
blog.phplabs.net
Reply With Quote
  #3 (permalink)  
Old 11-01-11, 06:04 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
$row should be $Row.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined variable not sure why cyberfolli PHP 9 05-06-11 08:29 AM
Undefined variable problem multicash PHP 0 09-02-10 01:28 PM
No error message... stormshadow PHP 3 12-11-06 06:31 PM
probably easy undefined variable problem jonnekke PHP 1 04-04-06 09:49 AM
Problems getting PHP-Nuke setup correctly TravisT PHP 2 12-17-05 07:54 PM


All times are GMT -5. The time now is 08:52 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.