Jump to content

bubblegum.anarchy

Members
  • Posts

    526
  • Joined

  • Last visited

    Never

Everything posted by bubblegum.anarchy

  1. Are you still having trouble with that first query?
  2. Definitely group by, DISTINCT is the most useless modifier I've ever come across (except inside a COUNT() ). or GROUP_CONCAT
  3. http://www.php.net/errorfunc
  4. Confirm that Oracle uses the same GROUP_CONCAT function as MySQL does. EDIT: Oracle does not appear have a group_concat function.
  5. What is a regged email and what does the array have to do with anything if the query output is fine?
  6. What don't work? - you have to submit the information first.
  7. I doubt that the client used matters but just incase - ALTER queries performed via SQLyog community v5.31
  8. Use DISTINCT or GROUP BY to remove the duplicates.
  9. Use the php trim function: trim($key)
  10. change the following line: GetSQLValueString($_POST['period'], "text"), to: mysql_real_escape_string($_POST['period']), so that no quoting occurs.
  11. Change this line: <?php $tsel = mysql_query("select * from `users` where `userlevel`='0' and `status`='alive' order by `rank` desc limit 10"); while ($top=mysql_fetch_array($tsel)) { // line 36 print "<tr><td></center><a href=profile.php?viewuser=$top[username]>$top[username][/url]</td><td align=right>$top[rank]</td></tr>"; } ?> To this: <?php $tsel = mysql_query($query = "select * from `users` where `userlevel`='0' and `status`='alive' order by `rank` desc limit 10") or trigger_error(mysql_error()."<PRE>".$query."</PRE>", E_USER_ERROR);; while ($top=mysql_fetch_array($tsel)) { // line 36 print "<tr><td></center><a href=profile.php?viewuser=$top[username]>$top[username][/url]</td><td align=right>$top[rank]</td></tr>"; } ?> ... and investigate the mysql error.
  12. Change this line: $sql = "UPDATE school_book SET title='$title', category='$category', type='$type', processed='$processed', image='$image', url='$url', description='$description', username='$username', user='$user' WHERE id=$id"; //replace school_book with your table name above $result = mysql_query($sql) or die(mysql_error()); To this: $sql = "UPDATE school_book SET title='$title', category='$category', type='$type', processed='$processed', image='$image', url='$url', description='$description', username='$username', user='$user' WHERE id=$id"; //replace school_book with your table name above die($sql); $result = mysql_query($sql) or die(mysql_error()); and post the result contained in $sql;
  13. heh... SELECT Max( report_date ) AS LatestDate, loc_id FROM report_index GROUP BY loc_id HAVING max(report_date) < CURRENT_DATE - INTERVAL 1 YEAR LIMIT 0 , 500
  14. unquote LatestDate in the WHERE clause: WHERE LatestDate < CURRENT_DATE - INTERVAL 1 YEAR
  15. I suggest renaming the radio element value attribute to MONTH and DAY and then something like this: adddate(CURRENT_DATE, INTERVAL $_POST['interval'] $_POST['period']); ... and perform the appropriate data integrity checks before querying.
  16. Basic table schematic: repository.id repository.date Query: SELECT * FROM repository ORDER BY repository.date DESC LIMIT 24
  17. $Int = addslashes("Pix 'outside' Interface");
  18. Post the three table structures, some test data and a detailed description of what you are trying to achieve.
  19. Something like this: SELECT the_friend.id, the_friend.name FROM users AS person INNER JOIN friends AS friend_of_theres ON person.id = friend_of_theres.friendid INNER JOIN users AS the_friend ON friend_of_theres.userid = the_friend.id LEFT JOIN friends AS friend_of_mine ON friend_of_theres.userid = friend_of_mine.friendid AND friend_of_mine.userid = person.id WHERE person.id = $_SESSION['userID'] AND friend_of_mine.userid IS NULL
  20. A table with a user id and product id vote.user_id vote.product_id To verify if the user has voted on any product: SELECT * FROM vote WHERE user_id = $user_id To get a total of votes for a product: SELECT count(*) FROM vote WHERE product_id = $product_id OR SELECT product_id, count(*) AS votes FROM vote GROUP BY product_id ORDER BY votes DESC # most votes first
  21. Using version #2 and the following query to order the records: SELECT FIND_IN_SET(PhotoId, PhotoOrder) AS orderby, Photos.* FROM Photos INNER JOIN `Album Categories` ON Photos,AlbumId = `Album Categories`.AlbumId ORDER BY orderby;
  22. Predefined variables, depending on how the data is posted... either $_GET['subcat'] or $_POST['subcat'], or regardless of the method used $_REQUEST['subcat']; Have a read: http://au3.php.net/manual/en/language.variables.predefined.php
  23. Place: print $query just after the call to mysql_query() and post the results - this is not a mysql issue if there is nothing unusual about the results.
  24. A server side variable can not be assigned a client side javascript value.
  25. Did you write that code, imarockstar?
×
×
  • 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.