Abdul Faizan
Dear sir,
i am studying your Advance PHP Lectures#10, i got an error on chrome browser(Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\collegeupdateform.php on line 29). by executing following code as i have given below.
 
please guide me what's a mistake i made in this Php code please solve it otherwise, i cant move forward to the next lecture without understanding it.

Best Regards
Abdul Faizan
0345265633
abdulfaizan88@gmail.com
-------------------------------------------------------------------------------------------- 
<?php
 
$con = mysql_connect("localhost","root","") or die("Connection fails");
mysql_select_db("college") or die("Database Error");
 
//echo "database and mysql connected";
 
$q = mysql_query("select * from studentinfo");
 
echo "<table border=1>
<th>Roll No</th>
<th>Name</th>
<th>Class</th>
<th>Update</th>";
 
 
 
while($rows = mysql_fetch_array($q))
{?>
<tr>
<td><? echo $rows[0];?></td>
<td><? echo $rows[1];?></td>
<td><? echo $rows[2];?></td>
 
</tr>
 
 
<? } ?>
</table>
Quote 0 0
Unregistered
brother write this
<tr>
<td><?php echo $rows[0]; ?></td>
<td><?php echo $rows[1]; ?></td>
<td><?php echo $rows[2]; ?></td>
 
</tr>
 
 
<?php } ?>
</table>
Quote 0 0
Unregistered
after while loop
while($rows = mysql_fetch_array($q))
{?>
the second line is ur error u should not put symbols with tags it will be a parse error,  u should use it like this { ?> put space and it will work fine, like you did in the last closing tab
<? } ?>
</table>

i hope u got the answer
Quote 0 0
Waqas Karamat
sir,
jab mey xampp instal karta ho to no free space ka error deyta hy jab k meyri drive mey space bohat hy please help me mey kistra instal karo run b

Quote 0 0
RIYAN MEHMOOD
Dear sir,
I am studying your Advance PHP Lectures # 6 "INTRODUCTION TO DATABASE", I got an error on chrome browser.

Fatal error
: Uncaught Error: Call to undefined function mysql_connect() in D:\xampp\htdocs\database.php:2 Stack trace: #0 {main} thrown in D:\xampp\htdocs\database.php on line 2.


CODING:-


<?php
$con=mysql_connect("localhost","root","") or die("connection fail");
echo "connection established";
?>


Please guide me what's a mistake i made in this Php code please solve it otherwise, Because code is not executed 5 times and still it is not executing, I cant move forward to the next lecture without understanding it.
Quote 0 0
 
Urdu IT Accademy � 2013 | License Agreement