Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. The rest of your code is using some database abstraction layer, and maybe the mysqli extension. What exactly is within your connection.php file?
  2. Where are these image tags coming from?
  3. Your going to need to post all your relevant code. Also, make sure you have error_reporting set to E_ALL and display errors switched on.
  4. Your <select></select> tags are outside of the <form> tags so will never be sent with it. Also, your creating more than one form there by having it within the while() loop.
  5. Hehe... Theres a type in my code. Try this.. if ($select_maxid = mysql_query("SELECT MAX(id) AS max_id FROM pages")) { $row = mysql_fetch_assoc($select_maxid) { echo $row['max_id']; } else { echo mysql_error(); }
  6. Use the code I posted above and post the exact output.
  7. date takes a timestamp, not a formatted date. You'll want to run your dates through strtotime to get a timestamp then into date.
  8. These little snippets of code don't help, we need to see some context.
  9. What format do the dates appear to be in? Example?
  10. Where is $dr defined? More relevant code would be helpful.
  11. Obviously the connection isn't being made. PS: That code is floored.
  12. You seriously need to learn some html. Can we see some relevant code?
  13. You need a http server and your much better off installing one locally. Google for Xampp to get up and running easily.
  14. Your much better off doing this within your query... DATE_FORMAT.
  15. if ($select_maxid = mysql_query("SELECT MAX(id) AS max_id FROM pages")) { $row = mysql_fetch_assoc($select_maxid) { else $row['max_id']; } else { echo mysql_error(); }
  16. This might help you.
  17. $PassSQL = "UPDATE admin SET Password='123415' WHERE Username = 'Admin'";
  18. <li><img src="a.jpg"></li><li><img src="b.jpg"></li><li><img src="c.jpg"></li>
  19. You are kidding right?
  20. Yes its all possible, but you'd need to learn a programming language first.
  21. Have you tried checking your query actually succeeds before using any result it produces? Any debugging at all? What does mysql_error() have to say?
  22. Post your current code.
  23. Providing you have userid stored within the $_SESSION array something like this will do the trick. <?php session_start(); $sql = "SELECT points FROM users WHERE userid = {$_SESSION['userid']} LIMIT 1"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); echo "You have {$row['points']} points"; } }
  24. Id do a Google search for 'web screenshot api' or similar. Ive seen these around, buts its going to cost you.
  25. You need always check your query succeeded and returns some records before you try and use it. You can also catch any errors and debug them a little better. <?php $sql = "SELECT AND SHOW COLUMNS FROM `members` WHERE field='Lens' AND username LIKE '$username'"; if ($result = mysql_query($sql))) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_row($result)) { echo '<select name="lens" style="margin-left:10px; width: 200px; font-size:11px"/>'; echo "<option value=\"0\">Please Select...</option>"; foreach (explode("','",substr($row[1],6,-2)) as $v) { print "<option value=\"".$v."\""; if (isset($_POST['Lens']) && $_POST['Lens']==$v) { print ' selected'; print ">$v</option>"; } } echo '</select>'; } } else { // no results found. } } else { trigger_error(mysql_error() . "<br />" . $sql); } ?> If your expecting more than one result your html is going to be foobar'd. If your not expecting more than one result, you don't need the while loop and should probably put a LIMIT clause in your query.
×
×
  • 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.