Jump to content

Nightseer

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Nightseer's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [quote author=keithschm link=topic=110272.msg445463#msg445463 date=1159813737] echo out $id and make sure it is getting that [/quote] Got it-lol-that wasn't the problem, but using echo on the other variables, I found the problem in the query. Thank you:)
  2. Figured part of it out-now getting: Parse error: syntax error, unexpected '>' in /home/virtualp/public_html/view_topic.php on line 21 and can't figure out how to remove it and keep link. code now is: [code]<?php include('inc/membersonly.php'); include('h2.php'); // get value of id that sent from address bar $id=$_GET['id']; $sql="SELECT * FROM forum_question WHERE id='$id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); $author = $row['fid']; $message = $row['detail']; $subject = $row['topic']; $datetime = $row['datetime']; echo "<table width=\"400\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#CCCCCC\"><tr> <td><table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bordercolor=\"1\" bgcolor=\"#FFFFFF\"><tr> <td bgcolor="#F8F7F1"><strong>$subject</strong></td></tr> <tr><td bgcolor=\"#F8F7F1\">$message</td></tr> <tr><td bgcolor=\"#F8F7F1\"><strong><b>Author:</b> <a href=account.php?vmid=$author>" . getUsername($author) . "</a></td></tr> <tr><td bgcolor=\"#F8F7F1\"><strong>Date/time : </strong>$datetime</td></tr></table></td></tr></table> "; ?>[/code]
  3. yes, $id echoes as 1 (the test message I'm trying to view.
  4. Can someone please tell me why this isn't working? I'm really trying, but I'm very new to this, and I have now been going over the same code for two days with no success:( This is the first thing I've actually tried to write myself (not modify from open source) and I got it where the rest is working-you caqn add the message to the database, but I cannotr get it to view how I want it...... [code]<?php include('inc/membersonly.php'); include('h2.php'); // get value of id that sent from address bar $id=$_GET['id']; $sql="SELECT * FROM forum_question WHERE id='$id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); $author = $row['fid']; $message = $row['detail']; $subject = $row['topic']; $datetime = $row['datetime']; echo "<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr> <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="1" bgcolor="#FFFFFF"><tr> <td bgcolor="#F8F7F1"><strong>$subject</strong></td></tr> <tr><td bgcolor="#F8F7F1">$message</td></tr> <tr><td bgcolor="#F8F7F1"><strong><b>Author:</b> <a href=account.php?vmid=$author>" . getUsername($author) . "</a></td></tr> <tr><td bgcolor="#F8F7F1"><strong>Date/time : </strong>$datetime</td></tr></table></td></tr></table> "; ?>[/code]
  5. You can also add a true/false field in the lkisting table. Any payment processor would be able to pass at LEAST one variable-then you just have script set it to true when it comes back:)
  6. No-it lists the dogs correctly-lol-though that solved another list problem I was working on. I'm not sure WHY that one lists correctly-but it does....
  7. Um-that code seems to be working fine? Was needing a way to make it list on more than one page.....
  8. Is there an easy way to do pagination? I have now tried every tutorial I can find and still getting some of the most aggravating errors............and of course, it just didn't work. Anyway, the code below is the function that needs it-if you can help, or point in correct direction, it would be GREATLY appreciated ??? [code]<? function market($breed, $gender) { $loop = mysql_query("SELECT * FROM dogs WHERE sellprice > 0 ORDER BY sellprice") or die ('cannot select dogs for sale'); $count = mysql_num_rows($loop); $i = 1; $cols = 2; while ($row = mysql_fetch_array($loop)) { $dogid = $row['dogid']; $name = getName($dogid); $breed = getBreed($row['breed']); $age = getAge($dogid); $price = getSalePrice($row['sellprice']); if($i == 1){ echo "<tr>"; } echo " <td align=\"left\" valign=\"top\" width=\"50%\"><br><a href=dog.php?dogid=$dogid>$name</a>, $breed $age $price" . "</td>"; if($i == $cols){ echo "</tr>"; $i = 1; } else{ $i++; } } }//end while ?>[/code]
  9. Figured it out-ownerid wasn't updating right (despite echoing correctly????) Just got it fixed about ten minutes ago:) Thanks for trying!
  10. I am very new to this, and have run iunto a roadblock trying to make my site more secure. The query works like this: [code]mysql_query("UPDATE core SET daysleft=daysleft-1 WHERE core='$core'") or die ('cannot subtract days');[/code] But when I try to add the account owner to it, it stops working. The variable is correct-checked it by having it echo before it tries to query-- [code]mysql_query("UPDATE core SET daysleft=daysleft-1 WHERE core='$core' AND ownerid='$mid'") or die ('cannot subtract days');[/code] The way it is now, anyone can subtract days from someone else's account-I could really use some help here ???
  11. OK. I am very new at this, and need the info below to display as a table....... This is the original: $loop = mysql_query("SELECT * FROM dogs WHERE ownerid='$mid'") or die ('cannot select this members dogs'); $count = mysql_num_rows($loop); while ($row = mysql_fetch_array($loop)) { $dogid = $row['dogid']; $name = getName($dogid); $breed = getBreed($row['breed']); $age = getAge($dogid); $groom = ($row['groomed']); echo  " <tr> <td align=\"left\" valign=\"top\" width=\"25%\"><a href=dog.php?dogid=$dogid>$name</a>, $breed age $age <br>Grooming $groom%" . "</td>"; }//end while and I tried this, which workedfor the first 4, but kept repeating the last command: $loop = mysql_query("SELECT * FROM dogs WHERE ownerid='$mid'") or die ('cannot select this members dogs'); $count = mysql_num_rows($loop); while ($row = mysql_fetch_array($loop)) { $dogid = $row['dogid']; $name = getName($dogid); $breed = getBreed($row['breed']); $age = getAge($dogid); $groom = ($row['groomed']); echo  " <tr> <td align=\"left\" valign=\"top\" width=\"25%\"><a href=dog.php?dogid=$dogid>$name</a>, $breed age $age <br>Grooming $groom%" . "</td>"; while ($row = mysql_fetch_array($loop)) { $dogid = $row['dogid']; $name = getName($dogid); $breed = getBreed($row['breed']); $age = getAge($dogid); $groom = ($row['groomed']); echo  " <td align=\"left\" valign=\"top\" width=\"25%\"><a href=dog.php?dogid=$dogid>$name</a>, $breed age $age <br>Grooming $groom%" . "</td>"; while ($row = mysql_fetch_array($loop)) { $dogid = $row['dogid']; $name = getName($dogid); $breed = getBreed($row['breed']); $age = getAge($dogid); $groom = ($row['groomed']); echo  " <td align=\"left\" valign=\"top\" width=\"25%\"><a href=dog.php?dogid=$dogid>$name</a>, $breed age $age <br>Grooming $groom%" . "</td>"; while ($row = mysql_fetch_array($loop)) { $dogid = $row['dogid']; $name = getName($dogid); $breed = getBreed($row['breed']); $age = getAge($dogid); $groom = ($row['groomed']); echo  " <td align=\"left\" valign=\"top\" width=\"25%\"><a href=dog.php?dogid=$dogid>$name</a>, $breed age $age <br>Grooming $groom%" . "</td><tr>"; } } } }//end while My question is how do I make it go back to the top? I know it's possible, but after searching for 2 days, I'm stumped.......and I know it's probably something really simple that I've missed
×
×
  • 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.