As a complete php/sql noob, I've been trying to set up a very basic thingy on a server. I have a db up with a table, and I'm trying to read it on a php page. Here is the relevant part of my code:
<?php
$con = mysql_connect("localhost", "----", "----") or die(mysql_error());
mysql_select_db("my_db") or die ("Select db fail!");
$ings = mysql_query($con, "SELECT * FROM Table") or die("Query fail: " . mysql_error());
mysql_close($con);
?>
The output is:
Query fail:
I can't wrap my head around it. mysql_error
does not return anything. I've tried mysql_errno
and it returns 0
, I've tried mysql_num_rows($ings)
and it returns nothing.
Any insight?