Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. I don't think your supposed to put quotes around the field names. Try: INSERT INTO dnh_subscribers (email, datetime, ip) VALUES ('$email','$datetime','$ip')
  2. Check this site out: http://tech.petegraham.co.uk/2007/03/22/php-remove-values-from-array/
  3. Try this: if ($row['sect1'] != '' && !empty($row['sect1']))
  4. Okay, I fixed the glitch. Final query: DELETE FROM forum_threads ,forum_replies USING forum_categories LEFT JOIN forum_threads ON forum_categories.categoryID = forum_threads.categoryID LEFT JOIN forum_replies ON forum_replies.threadID=forum_threads.threadID WHERE forum_categories.categoryID = 1
  5. EDIT: Hold on guys, I've been testing it and I think I see a problem. zenag - Thank you, that worked great. All I had to do was take "forum_categories" out of the DELETE FROM clause. Here is the final query that worked: DELETE FROM forum_threads ,forum_replies USING forum_categories LEFT JOIN forum_threads ON forum_categories.categoryID = forum_threads.categoryID LEFT JOIN forum_replies ON forum_replies.threadID=forum_threads.categoryID WHERE forum_categories.categoryID = 1 Thanks fenway, keeB, zenag, and BlueSkyIS for all the help! I appreciate it.
  6. Could you explain why are are wanting to assign each row to a different variable? Maybe someone can suggest a better way. Also, it would be helpful if you posted the code you already have.
  7. You don't use double equal signs in a query. <?php $ip = $_SERVER['REMOTE_ADDR']; $ipduplicate = mysql_query("SELECT COUNT(*) FROM ip WHERE ip='$ip'"); $count = mysql_result($ipduplicate, 0); if ($count <= 0) { $ipquery = mysql_query("INSERT INTO ip (ip) VALUES ('$ip')"); } else { echo "ERROR: Duplicate"; } ?>
  8. Awesome, so did you get everything working okay?
  9. Try doing this: mysql_select_db("list", $con)or die(mysql_error());
  10. To separate your results into pages your need to use pagination. Just Google "PHP MySQL pagination" and you should get plenty of results. As for displaying your data in columns, take a look at this post (tutorial): http://www.phpfreaks.com/forums/index.php/topic,95426.0.html
  11. Whenever they post log the time in a datetime field. Then whenever they post again check if it's been 30 minutes since the time in the database, which would be the time of their last post.
  12. Change your loop to: <?php $counter = 1; while($row = mysql_fetch_array($result)) { echo '<table border="1">'; echo '<tr>'; echo '<td>Number</td>'; echo '<td>Title</td>'; echo '<td>Budget</td>'; echo '<td>Url</td>'; echo '</tr>'; echo '<tr>'; echo "<td>$counter.</td>"; echo "<td>{$row['title']}</td>"; echo "<td>{$row['budget']}</td>"; echo "<td>{$row['url']}</td>"; echo '</tr>'; echo '</table>'; $counter++; } ?>
  13. Name each checkbox something like "approve[]" and make the value the Images ID from the DB. EX. <input type="checkbox" name="approve[]" value="{$row['images_ID']}"> Then at the top of the script put this code: <?php if (isset($_POST['your_submit_button'])){ if (!empty($_POST['approve'])){ foreach ($_POST['approve'] as $imageID){ $imageID = (int)$imageID; $query = mysql_query("UPDATE image_table SET approved='yes' WHERE imageID=$imageID")or die(mysql_error()); } } echo "Images Approved"; } ?> Obviously change the queries to match your database.
  14. All I did was change this: DELETE forum_categories, forum_threads, forum_replies To: DELETE forum_threads ft, forum_replies fr That stopped it from deleting the row in "forum_categories". So are you sure the tables listed there have nothing to do with what is deleted? My current query is still: DELETE forum_threads ft, forum_replies fr FROM forum_categories fc, forum_threads ft, forum_replies fr WHERE ft.categoryID = fc.categoryID AND fr.threadID = ft.threadID AND fc.categoryID = 3 I'm completely lost on what to do next.
  15. I'm also willing to do this project for you if you decide you can't do it yourself. You can contact me through a private message, or my email is stuckencolin@hotmail.com.
  16. Try this: <?php if (isset($_POST['your_submit_button'])){ foreach ($_POST['type'] as $key => $val){ $val = trim($val); if ($val == "") $error[] = "You left $key blank"; } if (!empty($error)){ foreach ($error as $err){ echo $err.'<br>'; } } else { echo "Everything was filled out correctly"; } } ?>
  17. Take a look at the following tutorials: http://www.tizag.com/phpT/filecreate.php http://www.tizag.com/phpT/fileopen.php http://www.tizag.com/phpT/fileclose.php http://www.tizag.com/phpT/filewrite.php
  18. You need to use pagination. Google "PHP MySQL pagination" and you will get plenty of help.
  19. You can do this using pagination. Just google "PHP MySQL pagination" and you should get plenty of help.
  20. Try to unset the session before you redirect. You could also use session_destroy() instead to destroy all sessions.
  21. The first table is more efficient. If you did the second one, how would you know how many columns to make? You would have to make hundreds, if not thousands...and there would be tons of empty ones, thats not efficient at all.
  22. Try this <?php $query = "SELECT SUM(times_selected) as Total FROM war"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); $percent = $row['Total'] / ($row['Total'] x 100); echo $row['Total'].' | '. $percent; ?>
  23. It sounds like you need an UPDATE query. The rows actually exist already, so you want to update the columns. UPDATE tablename SET column1='new value', column2='new value' WHERE [...]
  24. You could separate each value by a delimiter, then explode() it when you use the data. So, something like this: <select> <option value="value1-value2-value3"> <option value="value1-value2"> </select> Give more information on what values your trying to pass, and why you need the multiple values. There could be a better way.
×
×
  • 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.