
dodgeitorelse3
Members-
Posts
170 -
Joined
-
Last visited
-
Days Won
3
Everything posted by dodgeitorelse3
-
help with retriving database's data
dodgeitorelse3 replied to AnishThapaliya's topic in PHP Coding Help
Show us the code you have tried please. -
if I understand correctly this should work. echo "<div class='field-container'>"; if($game['platform2'] !== ""){ echo "<div class='title'>Platform</div> <div class='information'>{$game['platform2']}</div> <div class='title'>Launcher</div> <div class='information'>{$game['launcher2']}</div>"; } echo "</div>";
-
That updates database but I think you also need a select query to be able to have correct radio button ticked when your page loads.
-
I don't see a database query. That would be a good place to start.
-
Error on cell phone
-
The where clause posted above in index.php looks wrong
-
I see nothing in code for md5sum so how do you know what is being returned?
-
PHPMail stopped sending HTML-based emails
dodgeitorelse3 replied to vbcoach's topic in PHP Coding Help
ignore this please. -
PHPMail stopped sending HTML-based emails
dodgeitorelse3 replied to vbcoach's topic in PHP Coding Help
why not post both scripts so we can try to remove more confusion? -
How to select ID by changing xml file with PHP
dodgeitorelse3 replied to RRO's topic in PHP Coding Help
Always show your current code. Much easier to find syntax errors as well as any other mistakes possibly entered as code. -
This doesn't use your api but if page is always formatted that way then possibly <?php //DOLLAR// $json_dolar=file_get_contents("https://mercados.ambito.com//dolar/informal/variacion"); $dolar=explode("\",", substr_replace(trim($json_dolar, '{}') ,"",-1)); echo trim(explode("\":\"", $dolar[4])[1])."<br><br>"; foreach($dolar as $key => $value){ echo $value." OR ".trim(explode("\":\"", $dolar[$key])[1])."<br>"; } ?> Which displays up "compra":"202,50 OR 202,50 "venta":"206,50 OR 206,50 "fecha":"04\/01\/2022 - 16:45 OR 04\/01\/2022 - 16:45 "variacion":"0,24% OR 0,24% "class-variacion":"up OR up
-
You can read up on radio buttons at https://html5-tutorial.net/forms/radiobuttons/
-
array_push issue from within foreach
dodgeitorelse3 replied to dodgeitorelse3's topic in PHP Coding Help
I ended up with this however I suppose a php memory issue will arise when enough data is retrieved. $all_data = array(); foreach($id as $idkey => $iduse){ $temparr=array(); $result_time = $conn->query("SELECT * FROM ".$iduse." order by timedate Asc"); while ($rowtime = $result_time->fetch_row()) { $temparr[] = $rowtime; } array_push($all_data, array("id" => $idonly[$idkey], "comment" => $comment[$idkey], "data" => $temparr)); } Also thank you Barand for the fetch_row replacement. -
array_push issue from within foreach
dodgeitorelse3 replied to dodgeitorelse3's topic in PHP Coding Help
Ok I am aware of the sins. The database I am using was created 18 years ago. The gsreaders database has a table labeled lgsl. This table houses all the details for each game server we track. There is an ID column for each server. Gsreaders database also has several other tables. 3 for each server. This is where the design issue comes into play. These tables have no columns in them to be able to use joins. The only way I know which 3 tables go to each server is by table name. So if for example a game server has ID 80 then the 3 corresponding tables use that I'd in the table name such as scoreboard_80_time. I am working on a page to allow users to look up data for a single server or all servers. This is why I get a list of all active servers and put the id's in an array. Then, for lack of knowledge I use another sin by running queries in the foreach. The globals were only there to see if it was an issue if not being able to pass data. Global will not be used. I used fetch row because each query result array must have the I'd of the server in final array so I know what data goes to which server as in the all_player_data array. Using fetch row as you suggested does not give me this. So my original question is still being asked. There are currently 20 active servers so there will be 20 all_player_data arrays. As each is made how do I push each to all_data array that is defined outside the foreach? -
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)