Ken2k7
-
Posts
5,196 -
Joined
-
Last visited
Never
Posts posted by Ken2k7
-
-
Read file. That will return an array. That array has length equal to the number of lines in your text file. Each entry is a line in the file. So you can loop through it and just add the number at the end.
Does that make sense? Give it a try. It's not as hard as I made it to be. The link to file has great examples already.
-
Do you know how to use loops?
-
It doesn't make a lot of sense to GROUP more than one column. You can order by more than one. Can you provide sample data where you need to GROUP multiple columns? So just give an example of the records in the database and give the final result on what the outcome should be.
-
I forgot to add in a type check. >_<
SELECT number, COUNT(*) c FROM results WHERE type='type1' GROUP BY number ORDER BY datetime DESC LIMIT 100;
-
You want to store the values into an array and use a loop rather than a function because of variable scope.
-
// add this function to the top // this function takes an array of strings function f ($array) { $new_array = array(); foreach ($array as $key => $value) { $array[$key] = is_array($value)? f($value) : preg_replace('#[^\d]#', '', $value); } return $new_array; } // add these 3 lines after your echos $explode10 = f($explode10); $explode11 = f($explode11); echo $explode[0] + $explode11[0];
You can change the function name.
-
Well 100% is relative to the parent. Either give it a fixed width or wrap the div inside another div and give the parent div a fixed width, not a percentage.
-
You realize that there are leading and trailing spaces right? There's an extra space in front of both arrays at index 0 and there is a trailing space of both arrays at index 1.
-
The code I posted should work. Please output the following for me:
var_dump($explode10, $explode11);
Also, you have a mix-up of variable names. $bingo11 is not defined.
-
13. Duplication of topics is strictly prohibited. Users will not post duplicate topics' date=' if a topic needs moved please use the "Report to Moderator" button and a staff member will move the topic as soon as possible.[/quote']
http://www.phpfreaks.com/page/rules-and-terms-of-service
Please use this - http://www.phpfreaks.com/forums/index.php/topic,296582.0.html
As said, it should work. If not, then please show the output of those values.
-
Would these queries make sense to what you're trying to do?
$query = "DELETE a FROM attacktype_table a, encounter_table e WHERE a.encid = e.encid and e.starttime < DATE_SUB(CURDATE(),INTERVAL 30 DAY));";
Or:
$query = "DELETE a FROM attacktype a INNER JOIN encounter_table e WHERE a.encid = e.encid and e.starttime < DATE_SUB(CURDATE(),INTERVAL 30 DAY));";
-
Try:
SELECT number, COUNT(*) FROM results GROUP BY number ORDER BY datetime DESC LIMIT 100;
-
The PHP code is a bit confusing too because you have some code that doesn't really do anything except store some values into variables. I don't even know the final result of the SQL. So please post relevant bits of code or post what SQL you tried but it doesn't return the correct values.
-
Example:
SELECT COUNT(*) c FROM table WHERE DATE_SUB(CURDATE(), INTERVAL 1 DAY) <= timestamp_column AND userid = 1;
Take a look here - http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
It has tons of useful functions for you to pick at.
-
SELECT * FROM table WHERE status='1' AND value1<value2 ORDER BY rand() LIMIT 1;
-
Okay, so you have 2 tables. Are they related in any way?
Fruits Vegiess First row contain the records from category Bananas Carrots This and next row contain the records from items Apples Potatoes
That's confusing. Can you display the data as it appears in phpMyAdmin or something?
-
So basically, you just want to display the data of your database table on your web page?
-
What does it mean to reverse a xml file?
-
Hmm, maybe I should use that and run "DROP DATABASE mountainview3;"
-
i am talking about many to many relationship dude. i have to create a 3rd table to reference the 2 parent tables, you can say that it will be a foreign key
Well, don't use terms that are made up like "bridge table" because obviously it doesn't mean anything to us. I'm sorry we are not psychic. We do try to help, but if we don't understand something, we ask. You probably should be more grateful to people who are spending their free time (without pay) to help you. Don't be mad at us for your bad terminology.
-
Wow. Please do not post code like that if you want help. And read the rules, particularly Forum DOs section.
-
Are you serious? You just add them. $explode1 + $explode2
-
-
Well, the IRC server is currently down. For now you may join ##phpfreaks on irc.freenode.net.
That's actually useless because the channel is moderated.
Group And Order by troubles
in MySQL Help
Posted
How did you want the results to look like?