Hi everyone,
I'm Deno, and I'm new to this forum. I just purchased web hosting from totalchoicehosting last week, and I like it so far.
Anywho, I'm having some trouble with my php scripting, and I'm wondering if anybody can help me out, I'd really appreciate it:
I have a MySQL DB setup already, and when I want to do a simple data retrieval, say a user clicks on a link and retrieves that specific data on that specific link. However, when I uploaded my page to the webserver, I get an error that MySQL functions such as mysql_fetch_array and mysql_num_rows are INVALID functions. Why is this? Could someone explain to me how to get it running and what I'm doing wrong here. Again, any help would be totally appreciated.
Here's my code:
$Host = "localhost";
$User = "USERNAME
$Password = "PASSWORD";
$DBName = "DBNAME";
$TableName = "$select";
$Link = mysql_connect($Host,$User,$Password); //connect to the database
$Query = "select * from $TableName";
$Result = mysql_db_query($DBName,$Query,$Link);
if(mysql_num_rows($Result) == 0) {
print("No results to display.");
print("$select");
} //checks to see if there's any data to display
while ($Row = mysql_fetch_array($Result)) {
//print("<b><a href='newsdetail.php?detailno=$Row[newsID]'>$Row[headline]</a></b><p>");
print("$Row[name]<p><br></p>");
//}
mysql_close($Link); //close the connection