I have a question. This is a simple piece of php that should show the number of rows in a table.
<?php
$link = mysql_connect("localhost", "root", "1234") or die("Couldn't connect");
mysql_select_db("regulas", $link);
$result = mysql_query("SELECT * FROM index", $link) or die("Couldn't finish query");
$num_rows = mysql_num_rows($result);
echo $num_rows;
?>
However, the page displays:
Couldn't connect
I'm using a xampp server on my own computer: localhost
What am i doing wrong?
Thx Jules
indexis a reserved word in MySQL, it has to be enclosed in backticks to not produce a syntax error in this place.