I`m still having devil of a time getting my php to display the data from the mysql database.
<?php
//Date: February 25 2007
//For: www.secrettrance.net
//Description: Trancer Profile
session_start();
include("dbcon.php");
include("func.php");
require_once "auth.php";
require_once "includes/defines.php";
$lev=$_SESSION['level2'];
if($submit){
$s = $sub." by ".$name;
//$b= emote($bod);
mysql_query("INSERT INTO artistcomment (userID,subject,content,date,sender) VALUES ( '$g', '$s', '$bod', NOW(),$send )")or die ( mysql_error());
mysql_query("INSERT INTO messagedata (recBoxID, sendBoxID, content, subject, isNew, date) VALUES ($gall, '1', 'Profile Comment Recieved <br><a href=trancer.php?g=$gall>Please click here to go to your profile</a>.<br>This is automated message please do not reply.', 'New Profile comment received!', 1, NOW() )");
}
//get the users information
$query = "SELECT login, level, rName, age, gender, aim, yahoo, msn, icq, livejournal, bio,email, country, website,mood, status, icon, webcam, arttype FROM userdata WHERE id='$gall'";
$user = mysql_query($query) or die("Query failed: [$query] - " . mysql_error());
$res = mysql_query("SELECT COUNT(*) FROM artistcomment WHERE userID='$gall'");
$numCom = mysql_fetch_row($res);
mysql_free_result($res);
$res = mysql_query("SELECT COUNT(*) FROM image WHERE gallNum='$gall'");
$numImage = mysql_fetch_row($res);
mysql_free_result($res);
$res = mysql_query("SELECT id, name, gallNum, URL, description, addDate FROM image WHERE gallNum='$gall' ORDER BY id DESC");
$log = $user[0];
$Title = "Secret Trance: Trancer";
require_once "header.php";
require_once "hidestatus.php";
?>
<table border=0 width=100%><? //1
?>
<tr>
<td bgcolor="4A4553">
<table border=0 width=100%>
<tr>
<td bgcolor="312D37"><a href="trancer.php?g=<? echo $gall ?>"><img src="<? echo $user[16]; ?>" width=50 height=50 border=0></a>
<tr>
<td>
</table>
</table><? //1
?>
<?
require_once "footer.php";
?>
There`s the code I have for the entire page to display profiles. Currently I have in the stuff to display the icon. Yes, there is an icon in the database for the thing to pull out & display.
There are no error messages coming up on the browser (yes, error logging is on, & for a while error messages were coming up left & right & I got all those to go away but it still isnt working the way it should). Heres what the error log has to say:
[01-Mar-2007 09:51:55] PHP Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/secrett1/public_html/trancer.php on line 25
[01-Mar-2007 09:51:55] PHP Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/secrett1/public_html/trancer.php on line 26
[01-Mar-2007 09:51:55] PHP Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/secrett1/public_html/trancer.php on line 25
[01-Mar-2007 09:51:55] PHP Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/secrett1/public_html/trancer.php on line 26
[01-Mar-2007 09:52:25] PHP Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/secrett1/public_html/trancer.php on line 25
[01-Mar-2007 09:52:25] PHP Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/secrett1/public_html/trancer.php on line 26
[01-Mar-2007 09:52:26] PHP Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/secrett1/public_html/trancer.php on line 25
[01-Mar-2007 09:52:26] PHP Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/secrett1/public_html/trancer.php on line 26
HOWEVER
As I stated before, the error messages are finally gone off the page & the page is still not displaying the information from the database as it should. That is all the error log shows pertaining to this file. Im posting it because I know there will be someone asking what the error log says if I dont post it. Now that I have the error messages gone from the browser display, it is not saying anything more. I know there is still a problem because it still isnt working, php & the error log just arent telling me there is a problem or where it is, or much of anything.
Im stuck. Ive had other programmers look at it & cant figure it out. I looked through my huge php book, couldnt find anything. No online searches had a solution.