
hank9481
Members-
Posts
36 -
Joined
-
Last visited
Never
Everything posted by hank9481
-
You are correct as using PHPMyAdmin does the same thing; however, I plugged different versions of joins and still got the same result. What is it you need to see because I am at a loss?
-
I have a table that I want to pull selected data from and output into a table. The problem is, right now, only 1 record of data is being pulled, but much more should be. I'm not sure what I am doing wrong as the while loop should be ongoing. http://mblsim.com/form_hof.php Can someone help me figure this one out?
-
[SOLVED] PHP Table with Multiple Rows - Help
hank9481 replied to hank9481's topic in PHP Coding Help
Anybody? -
[SOLVED] PHP Table with Multiple Rows - Help
hank9481 replied to hank9481's topic in PHP Coding Help
Oddly enough, I changed it to assoc and it still doesn't work. Apparently, I am completely missing something small, but being horrible at this, I am hoping someone can spot what the heck I am doing wrong. Here is the entire code with the PHP related data in bold, maybe this will help? -
[SOLVED] PHP Table with Multiple Rows - Help
hank9481 replied to hank9481's topic in PHP Coding Help
Anyone else able to offer an explanation? I'd love to get this working. -
[SOLVED] PHP Table with Multiple Rows - Help
hank9481 replied to hank9481's topic in PHP Coding Help
Ha, you confused me immeasurably. -
I have a MySQL table with 7 fields. An ID field distinguishes each record because multiple records of data are stored in the table. What I want to do is create a PHP script that will display the most recent 5 records of data. Can someone give me some idea of what I have done wrong? Admittedly, I once knew how to do this, but having not dabbled with PHP for some years now, I have forgotten and am very much a novice. Right now, I only get the most recent entry. The key bits of the script are below:
-
I guess perhaps I just have an issue beyond solving? One of those crazy ones I know!
-
Okay I put the foreach loop at the very top and this is all that it did- Welcome, you are still logged in. team_id 14
-
Also, I input the foreach clause you requested just after the while clause. It didn't seem to change a thing as the result is the same-
-
Looks like nothing has been passed in for the id field in the query string. Do this near the top of the script and see what values are passed in:- foreach ($_GET as $Field => $Value) echo "$Field $Value <br />"; In you code examples you have passed id (first one) and team_id (second one). Which are you using at the moment? All the best Keith The actual field is called team_id so I assume I need to actually use that, yes?
-
Sorry for the confusion. This was the echo- Welcome, you are still logged in. SELECT T.name, T.nickname, HM.first_name, HM.last_name, S.mgr, TR.w, TR.l, P.grade, P.in, P.out, P.x_player, P.x_text, P.bo_player, P.bo_text, P.spec_hit, P.spec_hit_text, P.spec_pitch, P.spec_pitch_text, P.question, P.review, P.year, P.outlook, P.proj, P.l1, P.l2, P.l3, P.l4, P.l5, P.l6, P.l7, P.l8, P.l9, P.sp1, P.sp2, P.sp3, P.sp4, P.sp5, P.rp FROM previews P JOIN abbr A ON P.team_id=A.team_id JOIN teams T ON P.team_id=T.team_id JOIN human_managers HM ON P.team_id=HM.team_id JOIN staffs S ON P.team_id=S.team_id JOIN team_record TR ON P.team_id=TR.team_id WHERE P.team_id='' LIMIT 1
-
Thanks for your help.
-
Edited below.
-
Where is this query being executed? In what file are you trying to execute it? It should be in previews.php. Is that where it is? It's in previews_entry.php.
-
Neither suggestion has worked, but I'm not sure what I'm doing either! I tested the query in phpmyadmin just to be sure it works, and it was a success. It's obviously got to be something with my WHERE clause.
-
Can you clarify this a little bit more? I'm a complete amateur at this.
-
Honestly, you're dealing with such a noob here that I have no clue what those questions mean!
-
No luck. Any other thoughts? Here's the updated code...
-
I have a question that I may actually not be asking correctly as I am very much a noob. I use web forms to input data in MySQL tables and then pull that using PHP for my website. I have no issue inputting the data, but what I want to do is to pull the data back to the webform based on which option is selected, if this makes sense. Here is the code: Can someone give me an idea if this is possible or what I am doing wrong? Thanks!
-
Having another issue, hoping to get help. My page above now works, but I am working on creating a webform to input data. Here's the PHP Info- Can someone help me?
-
Correction. It did work! Thanks very much!
-
Believe me, I'm no expert, but that didn't work. Here's the link: http://mblsim.com/Season%20Previews/2018/previews.php?abbr=atl
-
I have a table of 30 different ID's. I have data in each row related to a particular ID, and based on a sort menu, I want to be able to jump to each where I have a page showing the data describing the selected ID. Such as = /2018/previews.php?abbr=atl.php The problem is, I cannot figure out how to make it work. For example, when I select something in my menu, it does nothing. Here's the code. Help me! $result = mysql_query("SELECT T.name, T.nickname, HM.first_name, HM.last_name, S.mgr, TR.w, TR.l, P.grade, P.in, P.out, P.x_player, P.x_text, P.bo_player, P.bo_text, P.spec_hit, P.spec_hit_text, P.spec_pitch, P.spec_pitch_text, P.question, P.review, P.year, P.outlook, P.proj, P.l1, P.l2, P.l3, P.l4, P.l5, P.l6, P.l7, P.l8, P.l9, P.sp1, P.sp2, P.sp3, P.sp4, P.sp5, P.rp FROM previews P JOIN abbr A ON P.team_id=A.team_id JOIN teams T ON P.team_id=T.team_id JOIN human_managers HM ON P.team_id=HM.team_id JOIN staffs S ON P.team_id=S.team_id JOIN team_record TR ON P.team_id=TR.team_id WHERE A.abbr=".$abbr." LIMIT 1") or die(mysql_error()); while ($row = @mysql_fetch_array($result,MYSQL_ASSOC)) {
-
I am now told my problem is a LEFT JOIN, or lack thereof. Can someone please help me identify just what that is? <? $result = mysql_query("SELECT P.player_id, P.last_name, P.first_name, B.hr, B.t, B.d, B.h, B.pa, B.bb, B.hp, B.ab, B.rbi, B.r, B.player_id, B.league_id, B.team_id, B.split_id, B.vorp, T.team_id, T.abbr, P.organization_id, POS.pos_id, POS.pos, P.position FROM players P, players_career_batting_stats B, teams T, position POS WHERE B.year=".$curYear." AND B.team_id<17 AND B.team_id!=12 AND B.league_id=100 AND B.split_id=1 AND B.player_id=P.player_id AND P.organization_id=T.team_id AND P.position=POS.pos_id AND B.pa>(162*3.1) GROUP BY B.player_id ORDER BY B.vorp DESC LIMIT 18") or die(mysql_error());; while ($row = @mysql_fetch_array($result,MYSQL_ASSOC)) { $tb=$row{'hr'}*4 + $row{'t'}*3 + $row{'d'}*2+ ($row{'h'} - ($row{'d'} + $row{'t'} + $row{'hr'})); $obp=($row{'h'} + $row{'bb'} + $row{'hp'}) / $row{'pa'}; $avg=$row{'h'} / $row{'ab'}; $slg=$tb / $row{'ab'}; $ops=$obp + $slg; $pos=$row{'pos'}; $first=$row{'first_name'}; $last=$row{'last_name'}; $team=$row{'abbr'}; $hr=$row{'hr'}; $rbi=$row{'rbi'}; $runs=$row{'r'}; print "<option value='".$first." ".$last."'>".$pos." ".$first." ".$last.", ".$team." (".substr($avg,0,5)." Avg, ".$hr." HR, ".$rbi." RBI, ".$runs." Runs, ".substr($ops,0,5)." OPS)</option>"; } ?>