I want to generate the deptno automatically.
Im using backend as mysql which allows auto-incrementation only for an integer,
not supports for varchar. So any code to do it?
Thank you.
Code blocks are created by indenting at least 4 spaces
... and can span multiple lines
<?php
$con = mysql_connect('localhost','root', ''); if (!$con) { die('Could not connect: ' . mysql_error()); }
mysql_select_db("stu", $con); $result = mysql_query("SELECT * FROM student"); while($row = mysql_fetch_array($result)) { echo $row['deptno'] . " " .$row['sname']
. " " .$row['age'];
echo "
";
}mysql_close($con); ?>
Code blocks are created by indenting at least 4 spaces
... and can span multiple lines