I'm going a little crazy here trying to figure this out.
Any help would be greatly appreciated.
MySQL version: 5.0
I'm trying to make a very ugly php page used to basic queries.
I have a similar page working that creates new records in the specified table, so I know my connection to the DB is fine (used the same info)
<?php
$id = $_POST['clientid'];
$fname = $_POST['clientfname'];
$lname = $_POST['clientlname'];
$dbc = mysql_connect('ip', 'login', 'password', 'dbname')
or die('Error connecting to MySql server.');
$query = "SELECT * FROM CLIENT WHERE id = '$id'";
$result = mysql_query($dbc, $query)
or die('Error querying database.');
$rownum = mysql_num_rows($result);
$i=0;
while ($i <= $rownum) {
$rid = mysql_result($result, $i, "id");
$rfname = mysql_result($result, $i, "fname");
$rlname = mysql_result($result, $i, "lname");
$rmphone = mysql_result($result, $i, "mphone");
$rhphone = mysql_result($result, $i, "hphone");
$raddress = mysql_result($result, $i, "address");
$remail = mysql_result($result, $i, "email");
$rtech_level = mysql_result($result, $i, "tech_level");
echo "$rid <br />";
echo "$rfname ' ' $rlname <br />";
echo "$rmphone <br />";
echo "$rhphone <br />";
echo "$raddress <br />";
echo "$remail <br />";
echo "$rtech_level <br />";
$i++;
}
mysql_close($dbc);
?>
I have gotten so many error codes I want to shoot myself.
Most of them are roughly:
mysql_query or mysql_num_rows or mysql_result: supplied argument is not a valid MySQL-Link resource
I would assume the issue is not getting a connection and therefor not know wtf any of these commands mean, but I have a connection on my other script, so yeah.. Confused.
I have tried putting an "i" in front of mysql on all my functions, same errors. I have slapped an "@" in front of the functions causing errors, but that simply returned a blank white page (suppressing the errors).
Thanks for any help I get!!