I'm trying to print data from mysql
but get these error
:
Warning:
mysql_query() expects parameter 1 to be string, resource given in
..
Warning: mysql_fetch_array() expects parameter 1 to be resource,
null given in ..
TCPDF ERROR: Some data has already been output,
can't send PDF file
I
have learn from these following links but still get
warning:
This
is the code:
$con=mysql_connect('localhost','root','','bkd_rev');
$sql = 'select * from
tbl';
$result = mysql_query($con,$sql);
if($result ===
FALSE) {
die(mysql_error());
}
while($row = mysql_fetch_array($result))
{
$id =
$row['id'];
$nam = $row['name'];
$tbl .= '
'.$id.' '.$nam.'
';
}
No comments:
Post a Comment