Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
He said every 5 results not the first 5. Try: $query = "SELECT iname, COUNT(ownerid) AS num FROM items WHERE ownerid=$sid GROUP BY iname "; $result = mysql_query($query) or die(mysql_error()); $x=1; while($row = mysql_fetch_array($result)){ echo ($x % 5 == 0) ? "" . $row['iname'] . "(x " . $row['num'] . ") " : $row['iname'] . "(x " . $row['num'] . ") "; $x++; }
-
Do addslashes() and mysql_real_escape_string() on $b_text before you do the UPDATE query.
-
What is the point of this site? It's a CLI for uploading images in a web browser... - When you try to delete a picture it throws an error. - There's no way to tell what the commands are if you've never been there before, even if you have it's impossible. - JPG files load really slow. At least it passes Mysql inject me.
-
I'm assuming this is a query...? Try: $query = "SELECT item, COUNT(ownerid) AS num FROM products GROUP BY item WHERE ownerid = 1"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['item'] . "(x " . $row['num'] . ") "; }
-
Ohhhhh nifty, I love writing less and less code....
-
Why do you have 50+ there are techniques to slim down your number of pages. For example you could add a variable on the end of your url: echo "page1"; echo "page2"; ?> other_page.php echo $_GET['page']; ?> Hope that help, but you would have to explain your situation a little better for us to come up with a solid solution.
-
Try using urlencode() on it, if that doesn't work then you have to use rawurlencode().
-
What's the point of that?
-
You have a comma right before the WHERE clause, remove it. EDIT: The comma doesn't exists 2 posts ago but your most recent it does, which one is it? If there really is no comman, then use this: mysql_query("UPDATE rate_blogs SET b_untext = '$b_text' WHERE b_id = '{$row['b_id']}') or die(mysql_error());
-
Valid commands...?
-
i just tried that actually I tried that and its echo'ing that data. do you think it's because i'm doing an Update and should be doing INSERT since that new fields are all blank? if so would this INSERT command work mysql_query ("INSERT INTO rate_blogs VALUES b_untext = '$b_text' WHERE b_id = '".$row['b_id']."'"); No. Add or die(mysql_error()); to the end of your queries and see if there are any errors;
-
OK sounds like you just need to create the "add_event.php" page to process/output the selected information from the form you posted. 1) In your form you need names for these text fields: Event Name: Event Venue: . . . 2) Here's how you would grab the values from the form after it is submitted: add_event.php foreach($_POST AS $key => $value) { $$key = $value; echo "Created variable: " . $key . " with value => " . $value; } ?>
-
sdi126 asked you a question that we kind of need to know the answer of before we help you... Is the code you posted add_event.php? If not, show us the code for that page as well.
-
You should really learn to use a for loop to generate all these dates, or use the built in calendar instead of hard coding all of this.
-
An example straight from the manual: function get_user_browser() { $u_agent = $_SERVER['HTTP_USER_AGENT']; $ub = ''; if(preg_match('/MSIE/i',$u_agent)) { $ub = "ie"; } elseif(preg_match('/Firefox/i',$u_agent)) { $ub = "firefox"; } elseif(preg_match('/Safari/i',$u_agent)) { $ub = "safari"; } elseif(preg_match('/Chrome/i',$u_agent)) { $ub = "chrome"; } elseif(preg_match('/Flock/i',$u_agent)) { $ub = "flock"; } elseif(preg_match('/Opera/i',$u_agent)) { $ub = "opera"; } return $ub; } ?>
-
Sure, you only had a few minor errors. The main thing was that when you select FROM a single table you don't need to specify that table before the column name. SQL thought you were referring to 2 tables because you had 2 sets of backticks. Mark as [sOLVED] please.
-
Why not? Is there something wrong or you're concerned about?
-
This should work, you had two sets of backticks on username, you also used plogger_collections.username when you only had to use username, and like steelaz said, any value that's not an integer should be surrounded with single quotes. See if this works. $sql = "SELECT name, description, path, id, thumbnail_id, username FROM `plogger_collections` WHERE `username` = 'test1' AND `id` IN (-1,2,4) ORDER BY id DESC LIMIT 0, 20"; NOTE: You really only need backticks for column names that are reserved words.
-
What do you mean it doesn't work? What exactly happens? Remove the single quotes around 'month' unless you literally mean month.
-
Change this line to this and tell me what the output is: mysql_query($query) or die(mysql_error());
-
Go to the Regex Section of this forum (a child forum of PHP Help) and search "email". Here's one that you might find useful: http://www.phpfreaks.com/forums/index.php/topic,234317.0.html
-
Even though I probably didn't help you, that's great to hear. I noticed you're from Philly, go Phils!
-
Assign the id of the student to "stu_id" and whatever you store for the picture (probably the relative path).