bubblegum.anarchy
Members-
Posts
526 -
Joined
-
Last visited
Never
Everything posted by bubblegum.anarchy
-
Are you still having trouble with that first query?
-
Looking for the most efficient way to do this
bubblegum.anarchy replied to gabeg's topic in MySQL Help
Definitely group by, DISTINCT is the most useless modifier I've ever come across (except inside a COUNT() ). or GROUP_CONCAT -
http://www.php.net/errorfunc
-
[SOLVED] Selecting duplicate values
bubblegum.anarchy replied to tommo74's topic in Other RDBMS and SQL dialects
Confirm that Oracle uses the same GROUP_CONCAT function as MySQL does. EDIT: Oracle does not appear have a group_concat function. -
What is a regged email and what does the array have to do with anything if the query output is fine?
-
MYSQL database don't update please help.
bubblegum.anarchy replied to jaylearning's topic in MySQL Help
What don't work? - you have to submit the information first. -
I doubt that the client used matters but just incase - ALTER queries performed via SQLyog community v5.31
-
Looking for the most efficient way to do this
bubblegum.anarchy replied to gabeg's topic in MySQL Help
Use DISTINCT or GROUP BY to remove the duplicates. -
Use the php trim function: trim($key)
-
[SOLVED] Using CASE to Compare Result and Add Dates
bubblegum.anarchy replied to dprichard's topic in MySQL Help
change the following line: GetSQLValueString($_POST['period'], "text"), to: mysql_real_escape_string($_POST['period']), so that no quoting occurs. -
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.
-
MYSQL database don't update please help.
bubblegum.anarchy replied to jaylearning's topic in MySQL Help
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; -
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
-
unquote LatestDate in the WHERE clause: WHERE LatestDate < CURRENT_DATE - INTERVAL 1 YEAR
-
[SOLVED] Using CASE to Compare Result and Add Dates
bubblegum.anarchy replied to dprichard's topic in MySQL Help
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. -
Basic table schematic: repository.id repository.date Query: SELECT * FROM repository ORDER BY repository.date DESC LIMIT 24
-
$Int = addslashes("Pix 'outside' Interface");
-
[SOLVED] ID's in one table and output values in other
bubblegum.anarchy replied to EagerWolf's topic in MySQL Help
Post the three table structures, some test data and a detailed description of what you are trying to achieve. -
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
-
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
-
Which 2 table structure is better for photo order storing
bubblegum.anarchy replied to cammac's topic in MySQL Help
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; -
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
-
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.
-
A server side variable can not be assigned a client side javascript value.
-
Did you write that code, imarockstar?