Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. I'm getting a "Invalid use of group function" error with that query =[ SELECT clubID, vote_for FROM (SELECT clubID, vote_for, COUNT(*) FROM club_votes GROUP BY clubID, vote_for ORDER BY COUNT(*) DESC) as x GROUP BY clubID Thank you both so much for helping me
  2. Change the line to this: <input type="text" name="First" maxlength="60" value="<? echo $row['First']; ?>">
  3. Maybe something like this: <?php $pages = array("forums", "chat", "news", "something"); if (in_array($c, $pages)){ echo "You are not logged in"; } ?>
  4. Have you been to this page? www.php.net/mcrypt
  5. Take a look at mcrypt() www.php.net/mcrypt
  6. Well, you can accept an array of ID's for the function parameter. <?php function id ($id_array){ //function stuff here } ?> Then inside your function you can loop through the array...
  7. You just need to put the $display_block inside the loop: <?php //connect to database include'db.php'; //get all data from table $sql = "SELECT * from products"; $result = mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli)); //if authorized, get the values while ($info = mysqli_fetch_array($result)) { $ItemNo = stripslashes($info['Item_No']); $Man = stripslashes($info['Manufacturer']); $Cat = stripslashes($info['Category']); $Des = stripslashes($info['Description']); $Model = stripslashes($info['Model']); $Qty = stripslashes($info['Qty']); $Kw = stripslashes($info['Kw']); $Hours = stripslashes($info['Hours']); $Price = stripslashes($info['Price']); //create display string $display_block = " <table border='1' cellspacing='0' cellpadding='0'> <tr> <td>".$ItemNo."</td> <td>".$Man."</td> <td>".$Cat."</td> <td>".$Des."</td> <td>".$Model."</td> <td>".$Qty."</td> <td>".$Kw."</td> <td>".$Hours."</td> <td>".$Price."</td> </tr> </table>"; //displays string with data echo "<p align=\"center\">"; echo "$display_block"; echo "</p>"; } ?>
  8. You surrounded your variable in single quotes. Change it to this: <?php $filename = $rows[3]; echo filesize($filename) . ' bytes'; ?> I'm not sure if filesize() will give you the size of an image...at least from what I'm reading from my google search. Maybe $HTTP_POST_FILES['file name']['size']
  9. mysql_real_escape_string() is used to prevent mySQL injection. You should use it on ALL variables before inserting them into the database. Addslashes() basically does the same thing. EXAMPLE USE: $var = mysql_real_escape_string($_POST['var']); You should google it and read more on the topic, their are plenty of articles out there about security.
  10. I agree with moberemk, the "Published Bar..." doesn't look very good. It either needs to be removed completely, or you need to make it more simple, like remove the table and just make the text a light gray color.
  11. Hmmm, I still can't figure this out =/ Illusion - I think I would rather find an alternative to your method...
  12. Use mysql_real_escape_string() on all your variables.
  13. Well, they really didn't say any of that...so I had to start somewhere. Webguync, you need to be a lot more specific if cooldude is right about what you want.
  14. Well, assuming you have the filename stored in the database...do this: <?php //get the image from the DB $query = mysql_query("SELECT image FROM images WHERE ...")or die(mysql_error()); $row = mysql_fetch_assoc($query); //display the image echo "<img src='path/to/image/".$row['image']."'>"; ?>
  15. Well, give us the code you have already...then tell us exactly what you want to do.
  16. Just use a hidden input. <input type='hidden' name='ID' value='<?php echo $row['id']; ?>'>
  17. If there is absolutely no way to get around the header errors, you can get away with this. Place ob_start(); at the top of your script, then at the end place ob_end_flush(); That should take care of all those errors for you, and you should be able to place the head code anywhere.
  18. Well, first off you select the ID from the database <?php $query = mysql_query("SELECT ID FROM table WHERE condition")or die(mysql_error()); $row = mysql_fetch_assoc($query); ?> To pass it on, you can use either a session, cookie, or hidden form input. If you have a submit button on that page, I would recommend the hidden form input...if not, I would use a session. Solution #1 - Hidden form Input <input type='hidden' name='id' value='<?php echo $row['id']; ?>'> Solution #2 - Session <?php $_SESSION['id'] = $row['id']; ?>
  19. No problem =] Don't forget to press "solved".
  20. Functions such as header() and setcookie() must be used before ANY output to the browser. My assumption would be that the file your including at the top has browser output in it. Does it work fine without including that file?
  21. Change your while loop to this: <?php $i = 0; while ($row = mysql_fetch_assoc($result)) { $thumb = "files/userimages/" .$row['thpicname1']; if ($i == 3){ echo '<tr>'; $i=0;} echo "<td border='3' width='250'><a href='files/profileview.php?find=".$row['username']."' target='_self'> <img src='".$thumb."'></a><br>" .$row['realname']. "<br>" . $row['city'] . " , " . $row['state'] . " <br>Current Rating " . $row['currentrate'] . "</td>"; $i++; } ?>
×
×
  • 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.