-
Posts
255 -
Joined
-
Last visited
-
Days Won
4
Everything posted by dodgeitorelse3
-
I have a foreach statement that contains 20 values. with each value I run a query on tables to return results. I can get it to create an array but it only shows last foreach values returned results. How do I get all 20 results to be in $all_data array. my code so far is $all_data = array(); foreach($id as $idkey => $iduse){ global $all_data, $all_player_data, $temparr, $data; $all_player_data = array(); $temparr = array(); $result_time = $conn->query("SELECT * FROM ".$iduse." order by timedate Asc"); $temptdarray = array(); while ($rowtime = $result_time->fetch_row()) { $timedate = $rowtime[0]; // row 0 $numplayers = $rowtime[1]; // row 1 $maxplayers = $rowtime[2]; // row 2 $status = $rowtime[3]; // row 3 $players = $rowtime[4]; // row 4 $mapname = $rowtime[5]; // row 5 $maptype = $rowtime[6]; // row 6 $data = array("timedate" => $timedate, "numplayers" => $numplayers, "maxplayers" => $maxplayers, "status" => $status, "players" => $players, "mapname" => $mapname, "maptype" => $maptype); array_push($temparr, $data); } $all_player_data[] = array("id" => $idonly[$idkey], "comment" => $comment[$idkey], "data" => $temparr); array_push($all_data[], array($all_player_data)); } if I print_r($all_data) I get all_data Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => [7] => [8] => [9] => [10] => [11] => [12] => [13] => [14] => [15] => [16] => [17] => [18] => [19] => ) if I print_r($all_player_data) I get all_player_data Array ( [0] => Array ( [id] => 80 [comment] => FooFire Attack Team [data] => Array ( [0] => Array ( [timedate] => 2021-03-17 16:34 [numplayers] => 0 [maxplayers] => 10 [status] => 1 [players] => [mapname] => SF Village Coop [maptype] => COOP ) [1] => Array ( [timedate] => 2021-03-20 07:12 [numplayers] => 1 [maxplayers] => 10 [status] => 1 [players] => --=P-51=-- [mapname] => SF Village Coop [maptype] => COOP ) [2] => Array ( [timedate] => 2021-03-20 07:26 [numplayers] => 2 [maxplayers] => 10 [status] => 1 [players] => --=P-51=--, [FFAT]herbstfuerst [mapname] => SF Village Coop [maptype] => COOP ) [3] => Array ( [timedate] => 2021-03-20 07:28 [numplayers] => 3 [maxplayers] => 10 [status] => 1 [players] => --=P-51=--, [FFAT]herbstfuerst, YAKIR [mapname] => SF Village Coop [maptype] => COOP ) .................blah blah blah [7223] => Array ( [timedate] => 2021-12-05 06:26 [numplayers] => 0 [maxplayers] => 10 [status] => 1 [players] => [mapname] => SF Village Coop [maptype] => COOP ) [7224] => Array ( [timedate] => 2021-12-05 07:26 [numplayers] => 0 [maxplayers] => 10 [status] => 1 [players] => [mapname] => SF Village Coop [maptype] => COOP ) [7225] => Array ( [timedate] => 2021-12-05 08:26 [numplayers] => 0 [maxplayers] => 10 [status] => 1 [players] => [mapname] => SF Village Coop [maptype] => COOP ) ) ) How do I get all 20 result sets into $all_data?
-
you still have 20 hardcoded with y to show it as 2021. Instead of y use Y.
-
crbug/1173575, non-JS module files deprecated.
dodgeitorelse3 replied to DevVinay's topic in PHP Coding Help
seems to be a chrome browser bug. see https://bugs.chromium.org/p/chromium/issues/detail?id=1173575 -
I am getting an error while creating the link.
dodgeitorelse3 replied to maviyazilim's topic in PHP Coding Help
???? -
PHP CSV Upload - Some rows in CSV file aren't in database
dodgeitorelse3 replied to KN1V3S's topic in PHP Coding Help
Is it really knr. in query? -
Notice: Undefined offset: , CSV Fileupload PHP
dodgeitorelse3 replied to KN1V3S's topic in PHP Coding Help
I see in your array that you printed out that there is an encoding issue (the diamonds with the question mark) -
Click the "at" in his reply
-
setting cookies after upgrading to HTTPS
dodgeitorelse3 replied to mmarkym's topic in PHP Coding Help
post your attempt with SHA1 -
setting cookies after upgrading to HTTPS
dodgeitorelse3 replied to mmarkym's topic in PHP Coding Help
I think your session_start () is in wrong place in AccountLinks.php -
If it is just for family or friends why not just use a login system to be able to post anything?
-
Can anyone help me find the problem in my php code form?
dodgeitorelse3 replied to rocknrolla's topic in PHP Coding Help
No links for code please. Just insert your code here without any links. -
Give Image to HTML through PHP-doesn't work
dodgeitorelse3 replied to mr_bob's topic in PHP Coding Help
A web server typically uses port 80 so what do you get without the :5500 in address? -
PHP Need nested user array values to dump into html table cell
dodgeitorelse3 replied to Thomas_L's topic in PHP Coding Help
missing closing square bracket at end of Json Format -
Best browser with the best tools for PHP development?
dodgeitorelse3 replied to sen5241b's topic in PHP Coding Help
in Firefox Developer menu bar choose Tools/Web Developer or right click on an element on web page and choose inspect element -
My apologies. I didn't see the commented out lines.
-
You have a button with type= button as well as type= submit and name of remove and at sane time you have an input with type=submit and name=remove.
-
What does title.php look like?
-
PHP Code breaks if any DB stuff is attempted
dodgeitorelse3 replied to X0ML's topic in PHP Coding Help
pg_connect from manual https://www.php.net/manual/en/function.pg-connect.php -
Have you tried to echo query to verify what it is using for login credentials?
-
I think you are going to want to run your if/else statement on your results instead of in your query.
-
how to use the values get in AJAX method in sql query?
dodgeitorelse3 replied to sashavalentina's topic in PHP Coding Help
Also with chart.js all arrays used for chart must have exact same number of items in each array. -
is the filename from files table stored with file extension?