Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. Your doing it the HARD way. <?php $result = mysql_query( "SELECT * FROM ibf_members ORDER BY RAND() LIMIT 1"); $row = mysql_fetch_assoc($result); $message = '<b>Member Name:</b> '.$row['member_name'];
  2. SELECT path, submitted_by, description FROM table_name ORDER BY RAND() LIMIT 1
  3. The only reason I can see this not working is if your images are NOT in the same directory, or you are misspelling the filename. Make sure the images are in the SAME folder as the script.
  4. Okay, so it's this line we are looking at mysql_query('UPDATE count SET count = count + 1'); The first thing I notice is that you specify the tables name as "count", and also the field name as "count". Are you sure the tables name is "count"? Your syntax should be like this mysql_query('UPDATE TABLE_NAME SET count = count + 1'); Also, you have no WHERE clause. So your query is going to update EVERY records "count" field +1, is that what you want?
  5. The code looks fine. Are you sure the image is in the same directory?
  6. echo '<pre>',print_r($_SERVER),'</pre>'; Execute that code and look through the output for what your looking for.
  7. Are you calling session_start() at the top of both scripts?
  8. Have you even tried Google?
  9. Try this $tablename = $datecode . $producttype;
  10. I put it in the code already, look for the comments (in yellow)
  11. Instead of having a field named "delete" in the database, use a uniqueID field. Do you have one that holds an auto-incremented ID? If you do, thats the field you should be using. I put comments in the code <?php if (isset($_POST['delete_fields'])){ //delete all checked rows $query = "DELETE FROM table_name WHERE id IN(".implode(",", $_POST['delete']).")"; $result = mysql_query($query)or die(mysql_error()."<p>With query:<br>$query"); echo "Rows Deleted<p>"; } echo "<table border='1'> <tr> <th>Delete</th> <th>Firstname</th> <th>Lastname</th> <th>Email</th> <th>Password</th> <th>Company</th> <th>Address1</th> <th>Address2</th> <th>Address3</th> <th>County</th> <th>Country</th> <th>Post Code</th> <th>Phone Number</th> <th>Validate</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td><form class='small'>'"; //You need to change the name to be an array, and the value should be your unique field. echo "<input type='checkbox' name='delete[]' value='{$row['UNIQUE_FIELD']}' /></p></td>"; echo "<td>" . $row['NAME_FIRST'] . "</td>"; echo "<td>" . $row['NAME_LAST'] . "</td>"; echo "<td>" . $row['EMAIL'] . "</td>"; echo "<td>" . $row['PASSWORD'] . "</td>"; echo "<td>" . $row['COMPANY'] . "</td>"; echo "<td>" . $row['ADDRESS1'] . "</td>"; echo "<td>" . $row['ADDRESS2'] . "</td>"; echo "<td>" . $row['ADDRESS3'] . "</td>"; echo "<td>" . $row['COUNTY'] . "</td>"; echo "<td>" . $row['COUNTRY'] . "</td>"; echo "<td>" . $row['POST_CODE'] . "</td>"; echo "<td>" . $row['PHONE'] . "</td>"; echo "<td>" . $row['VALIDATE'] . "</td>"; echo "</tr>"; echo "<input type='submit' name='delete_fields' value='Delete' target='delete.php?'/></p>"; } echo "</table>"; ?>
  12. $database = ("clintona_".$location."Inventory");
  13. They are not being repeated because you are using DISTINCT. Try SELECT dt_id from ctd_data where ctd_id IN(1, 2, 4)
  14. I second that. I've used the htmlpurifier class, and it works great.
  15. http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format
  16. You were close, change your query to SELECT * FROM affiliations ORDER BY RAND() LIMIT 1
  17. It still looks cramped. I agree with TheFilmGod, the third column is unneeded. All that information is provided in the link bar, if they want to see it, all they have to do is click. I think taking that third column out will really help.
  18. You only need one query, try this <?php $usern = "SELECT user, avatar, subject, date, news FROM news ORDER BY id DESC"; $userres = mysql_query($usern) OR die(mysql_error()); while($row = mysql_fetch_array($usern)){ echo "<div id='nstaff'> <p class='avatar'>"; echo "<img src='"; echo $row['avatar']; echo "' alt='' class='tinyav' /></p>"; echo "<div id='nstaffcont'>"; echo "<p id='title'>" . $row['subject'] . '</p>'; echo "<p id='user'>By: " . $row['user'] . '<br />'; echo "Posted On: " . $row['date'] . '</p>'; echo "<p id='news'>" . $row['news'] . '</p>'; echo "</div></div>"; } ?>
  19. What's the problem? I will just assume your getting an error with your query. Try this $geld2 = mysql_fetch_assoc($dbres2)or die(mysql_error() . "<p>With Query<br>$dbres2");
  20. Not sure what this has to do with PHP...but I would use CSS.
  21. Try this: $query = "SELECT * FROM $table WHERE '$table_id' = 69"; $q = mysql_query($query) or die (mysql_error()."<p>With Query<br>$query"); That will show you the query, and you can make sure all the variables are properly filled in as well.
  22. I agree, I didn't even see that. Seems a little pointless.
×
×
  • 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.