Jump to content

djfox

Members
  • Posts

    327
  • Joined

  • Last visited

    Never

Everything posted by djfox

  1. I have the following code: $res = mysql_query("SELECT coll_inven,id FROM userdata WHERE login='$log'"); $rows = mysql_fetch_row($res); mysql_free_result($res); $favs = explode(',',$rows[0]); //for each favorite get url and display foreach($favs as $fav){ if( $fav ){ $res = mysql_query("SELECT id,name,description,url,store,price,preview FROM collection WHERE id=$fav"); $img = mysql_fetch_row($res); if( $colCount%20 == 0 ){ echo "<tr>"; } $colCount = $colCount + 1; echo "<td><a href=collectionview.php?id=$fav><img src='collection/$img[6]' border=0></a>"; if(($_SESSION['level2']>6) || ( $_SESSION['level2']>1 && $_SESSION['sess_name'])){ echo ""; } } } The items are being displayed fine but how do I get them to be displayed in order of their id? I tried ORDER BY id ASC in this string: $res = mysql_query("SELECT id,name,description,url,store,price,preview FROM collection WHERE id=$fav"); $img = mysql_fetch_row($res); but that did not work. So is there a way to make those items list via id?
  2. It doesn`t work. I entered in the html and I just get errors.
  3. I want to create a randomizer. Some of the entries will be just plain text, some will have text with a clickable image. How do I create a randomizer that can do this?
  4. Oh I did not realize they were the same.
  5. What ended up working was this: WHERE forum_id=$id ORDER BY sticky DESC, recent DESC
  6. I am trying to get the forum to show sticky messages at the top with non-sticky messages below the stickies (I`m sure you`re familiar with nearly al forums doing this). But I can`t figure out how to get it to display that way. I have all the fields available for this in the database. But I can`t figure out how to get the php to work the way I need it to. Here`s what I`ve got: <table border=0 width=100%><? //5 ?> <tr> <td><b>Topic</b><td width=20%><b>Creator</b><td width=9%><b>Created</b><td width=8%><b>Replies</b><td width=9%><b>Update</b> <? $recent = 0; $res = mysql_query("SELECT id,user,subject,datetime,message_text,forum_id,recent,login,repl,sticky FROM forum WHERE forum_id=$id ORDER BY recent DESC")or die( mysql_error() ); while( ($fort = mysql_fetch_row($res)) && $recent < 25 ){ if( $recent%1 == 0 ){ echo "<tr><td bgcolor='312D37'><td bgcolor='312D37'><td bgcolor='312D37'><td bgcolor='312D37'><td bgcolor='312D37'><tr>"; } $recent = $recent + 1; echo "<td><font size=2><a href='thread.php?id=$fort[0]'>$fort[2]</a></font>"; echo "<td><font size=2><a href='trancer.php?id=$fort[1]'>$fort[7]</a></font>"; echo "<td><font size=2>$fort[3] </font><td><font size=2>$numCom[0] </font><td><font size=2>$fort[6] </font>"; } ?> </table><? //5 ?> It will display the threads just fine but I need the stickies to stick on top of the list. For the sticky field, 0 is for not a sticky message, and 1 is for sticky message.
  7. I have a comment system in which is set up in the profiles of my site. Now, I use the exact same system as I do with submission display file. The comment works for submission display. It will work for the profiles. But instead of refreshing to the profile, it will reload to a version of the profile where none of the data from mysql database loads & it gives an error message on line 235. Here is the section with line 236 in which line 236 is the one with "while($r = mysql_fetch...": <table border=0> <? $res = mysql_query("SELECT subject,content,date,id,sender FROM artistcomment WHERE userID=$gall ORDER BY id DESC"); while($r = mysql_fetch_row($res) ) $comments[] = $r; if ($comments) foreach($comments as $c){ ?> <tr><td bgcolor="312D37" colspan=2><a href="trancer.php?gall=<? echo $c[4] ?>"><? echo $c[0] ?></a> Date: <? echo $c[2] ?> #<? echo $c[3] ?> <tr><td colspan=2><? echo $c[1] ?> <tr><td> <? } ?> </table> Here is the error message: Here is what error log says: Here is the entire code for the profile file: <?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', 'Trancer Comment Recieved <br><a href=trancer.php?g=$gall>Please click here to go to your trancer profile</a>.<br>This is automated message please do not reply.', 'New trancer comment received!', 1, NOW() )"); } //get the users information $res = mysql_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_fetch_row($res); mysql_free_result($res); $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: $user[0]"; 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" valign=center><table border=0><tr><td valign=center><a href="trancer.php?gall=<? echo $gall ?>"><img src="<? echo $user[16]; ?>" width=50 height=50 border=0></a><td valign=center> <font size=6><b><? echo $user[0]; ?></b></font></table> <tr> <td> <table border=0 width=100%> <? //2 ?> <tr> <td valign=top> Real Name: <b><? echo $user[2]; ?></b> <br>Level: <b><? echo $user[1]; ?></b> <br>Status: <b><? echo $user[15]; ?></b> <br>Gender: <b><? echo $Gender[$user[4]] ?></b> <br>Age: <b><? echo $user[3] ?></b> <br>Country: <b><? echo $user[12] ?></b> <br>Mood: <b><? echo isset($user[14])?$Moods[$user[14]]:$Moods[0]; ?></b> <br>Artist Type: <b><? echo isset($user[18])?$arttype[$user[18]]:$arttype[0]; ?></b> <td valign=top> <div align=center> <table border=0> <tr> <td valign=top> <div align=left> Aim: <b><? echo $user[5]; ?></b> <br>Yahoo: <b><? echo $user[6]; ?></b> <br>Msn: <b><? echo $user[7]; ?></b> <br>Icq: <b><? echo $user[8]; ?></b> <br>Livejournal: <b><? echo $user[9]; ?></b> <br>Website: <b><a href="<? echo $user[13] ?>" target="_blank">Visit</a></b> <br>E-Mail: <b><a href="mailto:<? echo $user[11] ?>"><? echo $user[11] ?></a></b> </div> </table> </div> <td valign=top> <div align=right> <table border=0> <tr> <td valign=top> <div align=left> Images: <b><? echo $numImage[0] ?></b> <br>Profile Comments: <b><? echo $numCom[0] ?></b> <br>Policy Violations: <b>0</b> </div> </table> </div> </table> <? //2 ?> </table> </table><? //1 ?> <table border=0 width=100%><? //1 ?> <tr> <td> <tr> <td bgcolor="4A4553"> <table border=0 width=100%><? //2 ?> <tr> <td bgcolor="312D37"><center><b>Trancer Tools</b></center> <tr> <td> <center><a href="message.php?sendname=<? echo $user[0]; ?>">Send a Private Entranced Message to <? echo $user[0]; ?></a></center> </table><? //2 ?> </table><? //1 ?> <table border=0 width=100%><? //0 ?> <tr> <td> <tr> <td width=50% valign=top> <table border=0 width=100%><? //1 ?> <tr> <td bgcolor="4A4553"> <table border=0 width=100%><? //2 ?> <tr> <td bgcolor="312D37"><b>Recent Trances</b> <tr> <td> <table border=0> <? $n = $_SESSION['sess_name']; $rr = rtrim($user[0]); $rt = rtrim($n); ?> <? //Get each image in the users gallery $offset = isset($_REQUIRE['offset'])?$_REQUIRE['offset']:0; if(!$offset || $offsett<0) $offset=0; $recent = 0; while( $rows = mysql_fetch_row($res) ){ if( $recent >= $offset && $recent < ($offset + 10 )){ if( $recent%2 == 0 ){ echo "<tr><td><tr><td><tr><td><tr><td><tr>"; } //Display each image in gallery echo "<td width=16%><center><a href='trances.php?id=$rows[0]'><img src=thumbnail.php?img=$rows[3] border=0></a>"; echo "<br><b><a href='trances.php?id=$rows[0]'>$rows[1]</a></b><br> $rows[5]"; //If this is the current users gallery with proper level or an admin allow edit if( $gall==$rows[2] && $rr == $rt && $user[2] > 0 || $lev > 7) { echo "<br><font size=2><a href='tranceedit.php?id=$rows[0]'>Edit trance.</a></font>"; } //If this is the current users gallery or an admin allow delete if( $rr == $rt || $lev > 7){ echo "<br><font size=2><a href='deletetrance.php?id=$rows[0]'>Delete trance.</a></font>"; } echo "</center>"; } $recent = $recent + 1; } ?> </table> </table><? //2 ?> </table><? //1 ?> <td width=50% valign=top> <table border=0 width=100%><? //1 ?> <tr> <td bgcolor="4A4553"> <table border=0 width=100%><? //2 ?> <tr> <td bgcolor="312D37"><b>Biography</b> <tr> <td> <? echo $user[10] ?> </table><? //2 ?> <tr> <td> <tr> <td bgcolor="4A4553"> <table border=0 width=100%><? //3 ?> <tr> <td bgcolor="312D37"><b>Entranced Comments</b> <tr> <td> <table border=0> <? $res = mysql_query("SELECT subject,content,date,id,sender FROM artistcomment WHERE userID=$gall ORDER BY id DESC"); while($r = mysql_fetch_row($res) ) $comments[] = $r; if ($comments) foreach($comments as $c){ ?> <tr><td bgcolor="312D37" colspan=2><a href="trancer.php?gall=<? echo $c[4] ?>"><? echo $c[0] ?></a> Date: <? echo $c[2] ?> #<? echo $c[3] ?> <tr><td colspan=2><? echo $c[1] ?> <tr><td> <? } ?> </table> </table><? //3 ?> <tr> <td> <tr> <td bgcolor="4A4553"> <table border=0 width=100%><? //4 ?> <tr> <td bgcolor="312D37"><b>Leave an Entranced Comment</b> <tr> <td> <? $n = $_SESSION['sess_name']; $rr = rtrim($user[0]); $rt = rtrim($n); ?> <? if( $_SESSION['sess_name'] ){ $sender=$_SESSION['gal']; ?> <form action="trancer.php"> <input type=hidden name="name" value="<? echo $_SESSION['sess_name'] ?>"> <input type=hidden name="g" value="<? echo $gall ?>"> <input type=hidden name="send" value="<? echo $sender ?>"> Subject:<input type="text" name="sub" size="40"><br> Body: <font size=2><a href="emoticons.php" target="_blank">Emoticon Legend</a></font> <br><textarea rows="5" cols="65" name="bod" style="border: 0px; background-color:#141317; color: #B6ABCE;"></textarea><br> <input type="submit" name="submit" value="Leave Entranced Comment"> </form> <? } ?> </table><? //4 ?> </table><? //1 ?> </table><? //0 ?> <table border=0 width=100%><? //1 ?> <tr> <td> <tr> <td bgcolor="4A4553"> <table border=0 width=100%><? //2 ?> <tr> <td bgcolor="312D37"> <tr> <td> </table><? //2 ?> </table><? //1 ?> <? require_once "footer.php"; ?> In summary: What should be happening When the comment box is filled out & submitted, the profile file (trancer.php) should reload with the user`s information (the user the comment is being submitted to) along with the new comment. Also, a private message should be sent to owner of the profile that a new comment was added. The problem is The page loads, but all of the user`s information is gone. An error message sits in the spot where comments should be displayed (see above for error message). No private message is sent. You would have to edit the url bar to get to the user`s profile for it to display all the information again. New comment is there but has apparently been submitted twice. I can provide you with a username & password to use if you want to test this out to see what exactly is happening when the comment is posted. (I know I`m no good at describing things.)
  8. Ah thank you very much! That did the trick!
  9. Damn, that didn`t work either. It`s bothering me cuz I see the section for Biography where that bgcolor is working. I even copied that line to where Basic Information is, & that still didn`t work. I don`t understand why it works for Biography & not Basic Information.
  10. The page went blank & gave an error message when I converted the quotations. Here, let me post the entire file`s coding, maybe something else in it will be helpful in figuring out why the one piece of html is not working: <? /***************************************************************** settings.php Manage user settings ******************************************************************/ require_once "includes/defines.php"; require_once "includes/html.php"; require_once "dbcon.php"; require_once "auth.php"; require_once "hidestatus.php"; /* if not logged in, go to main page */ if (!isLoggedIn()) { Redirect("index.php"); } $UserID = $_SESSION['gal']; $Op = isset($_REQUEST['op'])?$_REQUEST['op']:OP_NONE; /* Form vars */ $u_name = isset($_REQUEST['rn'])?$_REQUEST['rn']:''; $u_email = isset($_REQUEST['email'])?$_REQUEST['email']:''; $u_age = isset($_REQUEST['age'])?$_REQUEST['age']:''; $u_gender = isset($_REQUEST['gender'])?$_REQUEST['gender']:0; $u_country = isset($_REQUEST['country'])?$_REQUEST['country']:'None'; $u_aim = isset($_REQUEST['aim'])?$_REQUEST['aim']:''; $u_yahoo = isset($_REQUEST['yahoo'])?$_REQUEST['yahoo']:''; $u_msn = isset($_REQUEST['msn'])?$_REQUEST['msn']:''; $u_icq = isset($_REQUEST['icq'])?$_REQUEST['icq']:''; $u_livejournal = isset($_REQUEST['livejournal'])?$_REQUEST['livejournal']:''; $u_website = isset($_REQUEST['website'])?$_REQUEST['website']:''; $u_icon = isset($_REQUEST['icon'])?$_REQUEST['icon']:''; $u_webcam = isset($_REQUEST['webcam'])?$_REQUEST['webcam']:''; $u_mood = isset($_REQUEST['mood'])?$_REQUEST['mood']:0; $u_arttype = isset($_REQUEST['arttype'])?$_REQUEST['arttype']:0; $u_bio = isset($_REQUEST['bio'])?$_REQUEST['bio']:''; /* Show user settings */ function ShowForm($Action) { global $u_name, $u_email, $u_age, $u_gender, $u_country, $u_aim, $u_yahoo, $u_msn, $u_icq, $u_livejournal, $u_website, $u_mood, $u_bio, $u_icon, $u_webcam; global $Gender, $Countries, $Moods, $arttype; $res = '<tr><td valign=top width=100% bgcolor="312D37" colspan=3><b>Basic Information</b>'.CR. '<tr><td width=100%><table border=0 width=100%>'.CR. '<form action="settings.php" method="post">'.CR. '<input type="hidden" name="op" value="'.$Action.'">'.CR. '<tr><td>Name: <br><input type="text" name="rn" size="30" value='.$u_name.'>'.CR. '<td>E-mail: <br><input type="text" name="email" size="30" value='.$u_email.'>'.CR. '<td>Age: <br><input type="text" name="age" size="4" value='.$u_age.'>'.CR. '<tr><td><tr><td><tr><td>'.CR. '<tr><td>Gender: <br>'; echo $res; ComboBox('gender',$Gender,$u_gender); echo '<td>Country: <br>'.CR; ComboBox('country',$Countries, $u_country); echo '<td>Mood: <br>'.CR; ComboBox('mood',$Moods, $u_mood); echo '<tr><td><tr><td><tr><td>Artist Type: <br>'.CR; ComboBox('arttype',$arttype, $u_arttype); $res = '<td>AIM Screenname: <br><input type="text" name="aim" size="30" value='.$u_aim.'>'.CR. '<td>Yahoo Screenname: <br><input type="text" name="yahoo" size="30" value='.$u_yahoo.'>'.CR. '<tr><td><tr><td><tr><td>'.CR. '<tr><td>MSN Screenname: <br><input type="text" name="msn" size="30" value='.$u_msn.'>'.CR. '<td>ICQ Screenname: <br><input type="text" name="icq" size="30" value='.$u_icq.'>'.CR. '<td>Livejournal Screenname: <br><input type="text" name="livejournal" size="30" value='.$u_livejournal.'>'.CR. '<tr><td><tr><td><tr><td>'.CR. '<tr><td>Website URL: <br><input type="text" name="website" size="30" value='.$u_website.'>'.CR. '<td>Icon URL: <br><input type="text" name="icon" size="30" value='.$u_icon.'>'.CR. '<td>Webcam URL: <br><input type="text" name="webcam" size="30" value='.$u_webcam.'>'.CR. '<tr><td valign=top width=100% bgcolor="312D37" colspan=3><b>Biography</b>'.CR. '<tr><td colspan=3><textarea name="bio" rows="10" cols="120" style="border: 0px; background-color:#141317; color: #B6ABCE;">'.$u_bio. '</textarea>'.CR. '<tr><td colspan=3><center><input type="submit" value="Enter"> <input type="reset" value="Clear"></center></form>'.CR. '</table>'.CR; echo $res; } /* Reads user info from database */ function ReadUserInfo($id) { global $u_name, $u_email, $u_age, $u_gender, $u_country, $u_aim, $u_yahoo, $u_msn, $u_icq, $u_livejournal, $u_website, $u_mood, $u_bio, $u_icon, $u_webcam, $u_arttype; if ($result=mysql_query("SELECT login, views, level, rName, age, gender, aim, yahoo, msn, ". "icq, livejournal, bio,email, country, website, mood, icon, webcam, arttype FROM userdata WHERE id=$id")) { if ($row=mysql_fetch_object($result)) { $u_name = $row->rName; $u_email = $row->email; $u_age = $row->age; $u_gender = $row->gender; $u_country = $row->country; $u_aim = $row->aim; $u_yahoo = $row->yahoo; $u_msn = $row->msn; $u_icq = $row->icq; $u_livejournal = $row->livejournal; $u_website = $row->website; $u_mood = $row->mood; $u_arttype = $row->arttype; $u_bio = $row->bio; $u_icon = $row->icon; $u_webcam = $row->webcam; } mysql_free_result($result); } } /* Reads user info from database */ function SaveUserInfo($id) { global $u_name, $u_email, $u_age, $u_gender, $u_country, $u_aim, $u_yahoo, $u_msn, $u_icq, $u_livejournal, $u_website, $u_mood, $u_bio, $u_icon, $u_webcam, $u_arttype; $qry = "update userdata set rName='$u_name',age='$u_age',gender='$u_gender',aim='$u_aim',yahoo='$u_yahoo',". "msn='$u_msn',icq='$u_icq',livejournal='$u_livejournal',bio='$u_bio',email='$u_email',country='$u_country',". "website='$u_website',mood='$u_mood',icon='$u_icon',webcam='$u_webcam',arttype='$u_arttype' ". " where id=$id"; @mysql_query($qry); } /* Check values */ function CheckValues() { global $u_name, $u_email, $u_age, $u_gender, $u_country, $u_aim, $u_yahoo, $u_msn, $u_icq, $u_livejournal, $u_website, $u_mood, $u_bio, $u_icon, $u_webcam, $u_arttype; $ok = false; if (!is_numeric($u_age)) { echo "<br> Age must be numeric<br>"; return $ok; } /* TODO - add more checks */ $ok = true; return $ok; } /***************************************************************** Main *****************************************************************/ switch ($Op) { case OP_SAVE : if (CheckValues()) { SaveUserInfo($_SESSION['gal']); Redirect("trancer.php"); }; break; default: ReadUserInfo($_SESSION['gal']); } $Title = "Secret Trance: Settings"; require "header.php"; ShowForm(OP_SAVE); require "footer.php"; ?>
  11. Crap, meant to make this a modified post to the first one...
  12. I know html. The problem is it`s INSIDE php. The regular html coding is not working. The code you just gave me didn`t work either.
  13. Please read everything before replying. $res = '<tr><td valign=top width=100% bgcolor=\"312D37\" colspan=3><b>Basic Information</b>'.CR. How I make it so that the page will make that td that colour? I`ve tried the following several different ways: bgcolor=\"312D37\" bgcolor="312D37" bgcolor='312D37' bgcolor=312D37 bgcolor=\"#312D37\" (edit 1:27pm) Is there anything that will make it made that td that colour that I want it to be? The result I get with all of those is no colour. I know html, the html is not working here. I`m figuring it has to do with it being within php coding. This bgcolor code works on all the other pages of mine I have except this one.
  14. The icon in the database is stored as VARCHAR, so all that has to be entered is the url. The page will pull out the url of the icon to display. In this case, it is "defaut.jpg" under the same directory that the file (trancer.php) is under. I know the icon is there & working because the same exact piece of information is called under another file (trances.php). The code for trances.php is as follows: <?php //Date: February 24 2007 //For: www.secrettrance.net //Description: Main Index include("dbcon.php"); include("func.php"); require_once "auth.php"; require_once "includes/defines.php"; $Title = "Secret Trance: Go into a Trance"; require_once "header.php"; require_once "hidestatus.php"; ?> <? $lev=$_SESSION['level2']; $res = mysql_query("SELECT id,name,gallNum,URL,rating,numRates,description,views,cat,addDate, feature, literature FROM image WHERE id=$id"); $rows = mysql_fetch_row($res); mysql_free_result($res); if($submit){ $s = $sub." by ".$name; $b= emote($bod); mysql_query("INSERT INTO comment (imageID,subject,content,date,sender) VALUES ( '$id', '$s', '$b', NOW(),$send)")or die ( mysql_error()); mysql_query("INSERT INTO messagedata (recBoxID, sendBoxID, content, subject, isNew, date) VALUES ($rows[2], '1', 'You have a new comment on one of your trances that you have submitted.<br><a href=trances.php?id=$id>Click here to read the comment</a>.<br>This is automated message please do not reply.', 'New Comment!', 1, NOW() )"); } if($policy && ($lev>6)){ mysql_query("UPDATE userdata SET violations=SUM(violations,1) WHERE login='$name'"); } $res = mysql_query("SELECT login FROM userdata WHERE id='$rows[2]'"); $by = mysql_fetch_row($res); mysql_free_result($res); $res = mysql_query("SELECT icon FROM userdata WHERE id='$rows[2]'"); $icon = mysql_fetch_row($res); mysql_free_result($res); $res = mysql_query("SELECT name, id FROM imagecats WHERE id=$rows[8]"); $catName = mysql_fetch_row($res); mysql_free_result($res); $res = mysql_query("SELECT COUNT(*) FROM comment WHERE imageID='$id'"); $numCom = mysql_fetch_row($res); mysql_free_result($res); //Update unique pageview counter if( !$_SESSION["sess_$id"] ){ $_SESSION["sess_$id"] = "visited"; $v = $rows[7] + 1; mysql_query("UPDATE image SET views=$v WHERE id='$id'"); } ?> <table border=0 width=100%><? //1 ?> <tr> <td width=15% valign=top> <? require_once "leftbar.php"; ?> <td width=80% valign=top> <table border=0 width=100%> <tr> <td> <table border=0 width=100%> <tr> <td bgcolor="4A4553"> <table border=0 width=100%> <tr> <td bgcolor="312D37"><table border=0><tr><td valign=center><a href="trancer.php?g=<? echo $rows[2] ?>"><img src="<? echo $icon[0] ?>" border=0></a> <td valign=center><b><font size=5><? echo $rows[1]?></font> <br><font size=4>by <a href="trancer.php?g=<? echo $rows[2] ?>"><? echo $by[0] ?></font></a></b></table> <tr> <td> <center><img src="<? echo $rows[3]?>"> <br>© <? echo $by[0] ?> <p> <font size=2>If this trance is not the artist`s original work or violates any of the policies, <a href="report.php">report</a> it immediately.</font></center> </table> </table> <table border=0 width=100%> <tr> <td> <tr> <td bgcolor="4A4553" valign=top width=50%> <table border=0 width=100%> <tr> <td bgcolor="312D37"><b>Trancer Comments</b> <tr> <td valign=top><? echo $rows[6]?> </table> <td> <td valign=top bgcolor="4A4553" width=50%> <table border=0 width=100%> <tr> <td bgcolor="312D37"><b>Details</b> <tr> <td> <font size=2> Title: <b><? echo $rows[1]?></b> <br>Trancer: <b><a href="trancer.php?g=<? echo $rows[2] ?>"><? echo $by[0] ?></a></b> <br>Date: <b><?echo $rows[9] ?></b> <br>Category: <b><a href="search.php?cat=<? echo $catName[1] ?>"><? echo $catName[0] ?></a></b> </font> <tr> <td bgcolor="312D37"><b>Stats</b> <tr> <td> <font size=2> Views: <b><? echo $rows[7] ?></b> <br>Comments: <b><? echo $numCom[0] ?></b> <br>Favourites: <b><? echo $numFavs[0] ?></b> <? //%%%%%%%%%%%%%%%% $rate=$rows[4]/$rows[5]; //%%%%%%%%%%%%%%%%%%% ?> <br>Rating: <b><? echo $rate ?></b> (<? echo $rows[5]?> votes)</font> <tr> <td bgcolor="312D37"><b>Fav Trance <tr> <td> <? if($_SESSION['sess_name']){ echo "<font size=2><a href=trancefavorite.php?id=$rows[0]&g=$rows[2]>Add Trance to Your Favourites</a></font>"; } ?> <tr> <td bgcolor="312D37"><b>Rate Trance <tr> <td> <? if($_SESSION['sess_name'] && !$_SESSION["img_$id"]){ ?> <form action="trancerate.php"> <input type="radio" name="r" value=0>0 <input type="radio" name="r" value=1>1 <input type="radio" name="r" value=2>2 <input type="radio" name="r" value=3>3 <input type="radio" name="r" value=4>4 <input type="radio" name="r" value=5>5 <input type="radio" name="r" value=6>6 <input type="radio" name="r" value=7>7 <input type="radio" name="r" value=8>8 <input type="radio" name="r" value=9>9 <input type="radio" name="r" value=10>10 <input type="hidden" name="id" value="<? echo $id ?>"> <br><input type="submit" value="Rate Trance"> </form> <? }else if($_SESSION["img_$id"]){ echo "You have already rated this trance for the day."; }else if(!$_SESSION['sess_name']){ echo "To rate this trance, you must be logged in."; } ?> <tr> <td bgcolor="312D37"><b>Featured</b> <tr> <td> <font size=2><?echo $rows[10] ?></font> </table> </table> <table border=0 width=100%> <tr> <td> <tr> <td bgcolor="4A4553"> <table border=0 width=100%> <tr> <td bgcolor="312D37"><b>Literature Trance <tr> <td> <?echo $rows[11] ?> </table> </table> <table border=0 width=100%> <tr> <td> <tr> <td bgcolor="4A4553"> <table border=0 width=100%> <tr> <td bgcolor="312D37"><b>Entranced Comments</b> (<font size=2><a href="#leavecomment">Leave Your Own Entranced Comment</a></font>) <tr> <td> <? $res = mysql_query("SELECT subject,content,date,id,sender FROM comment WHERE imageID=$id ORDER BY id DESC"); while($r = mysql_fetch_row($res) ) $comments[] = $r; if ($comments) foreach($comments as $c){ ?> <tr><td bgcolor="312D37" colspan=2><a href="trancer.php?g=<? echo $c[4] ?>"><? echo $c[0] ?></a> Date: <? echo $c[2] ?> #<? echo $c[3] ?> <tr><td colspan=2><? echo $c[1] ?> <tr><td> <? } ?> </table> </table> <table border=0 width=100%> <tr> <td> <tr> <td bgcolor="4A4553"> <a name="leavecomment"> <table border=0 width=100%> <tr> <td bgcolor="312D37"><b>Leave an Entranced Comment <tr> <td> <? if( $_SESSION['sess_name'] ){ $sender= $_SESSION['gal']; ?> <tr> <td> <table border=0 width=100%> <tr> <td valign=top> <form action="trances.php"> <input type=hidden name="name" value="<? echo $_SESSION['sess_name'] ?>"> <input type=hidden name="id" value="<? echo $id ?>"> <input type=hidden name="send" value="<? echo $sender ?>"> Subject: <td valign=top><input type="text" name="sub" size=40> <tr> <td valign=top>Comment: <br><font size=2><a href="emoticons.php" target="_blank">Emoticon Legend</a></font> <td valign=top> <textarea rows="5" cols="70" name="bod" style="border: 0px; background-color:#141317; color: #B6ABCE;"></textarea> <tr> <td><td> <input type="submit" name="submit" value="Leave Entranced Comment"> </form> </table> <? } ?> </table> </table> </table> </table><? //1 ?> <? require_once "footer.php"; ?> What bothers me the most about this, is that both trances.php & trancer.php (see first post) both access the same database, the same tables (both recall some information from userdata), they both use the same code. But trances.php works while trancer.php doesn`t. The code all seems the same to me. So I cannot figure out why trancer doesn`t work or even what the problem is (aside from trancer not loading the information as it is supposed to).
  15. 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 isn`t working the way it should). Here`s what the error log has to say: 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. I`m posting it because I know there will be someone asking what the error log says if I don`t 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 isn`t working, php & the error log just aren`t telling me there is a problem or where it is, or much of anything. I`m stuck. I`ve had other programmers look at it & can`t figure it out. I looked through my huge php book, couldn`t find anything. No online searches had a solution.
  16. Still need help with this.
  17. Yeah it`s really weird & is nearly making me think about sticking with the other host that has really bad service.
  18. Page still comes back blank, now with this error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/secrett1/public_html/trances.php on line 30 Line 30 would be the code you just gave me.
  19. Well if it doesn`t have the second space, it`ll print "byusername" rather than "by username".
  20. Oh lorddie, once on thing is changed, another one comes up: Parse error: syntax error, unexpected T_STRING in /home/secrett1/public_html/trances.php on line 31 line 31 is $s.=" by ";
  21. Now the page is completely white with just this error message: Parse error: syntax error, unexpected T_STRING in /home/secrett1/public_html/trances.php on line 30 Line 30 is: $s = $sub." by ".$name;
  22. Now it says: Error in SELECT id, name, gallNum, URL, rating, numRates, description, views, cat, addDate, feature, literature FROM image WHERE id= You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
  23. It just gives the same error messages.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.