+ 1

Help with PHP page (trying page.php?ID=XXX)

So, I'm trying to create one unique page called team.php, and depending on the ID it should show the players of THAT team. Per example, if Real Madrid has ID=78, the page team.php?ID=78 should you the players of Real Madrid. Everything goes OK except one little thing, the page shows all teams which ID is >25, but all the teams who have ID < 25 don't work. Can anyone help me with that? Here is my code: // Call team by ID $ID = $_GET['ID']; $callteam = "SELECT * FROM team_list WHERE id_team = '$ID'"; $docallteam = mysqli_query($conn, $callteam);

15th Feb 2018, 3:48 PM
Dani B
3 Antworten
+ 2
You haven't provided enough information on what "don't work," what errors you're getting, or the rest of your code. Can you post it up on Code Playground so I can view all of the code? Based upon the snippet you posted, nothing appears wrong with your MySQL code logic. That means the issues is coming from somewhere else. When it "don't work," what exactly is happening that makes you say that? Infamous blank white screen of PHP? PHP errors? (enabled PHP errors on your page if you haven't already) Undesired display of the data? Incorrect data? etc... Throw some more information my way and I'll help you figure this out. Display errors in PHP: (put this at TOP of your php page) ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
15th Feb 2018, 4:00 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 1
It said something about a "boolean result". The thing is that I've just found my problem. I wrote "WHERE id_team" but it should be "WHERE ID_team". I don't know if that was the problem, but at least now it works. Sorry for not giving enough information and thanks!!
15th Feb 2018, 4:45 PM
Dani B
+ 1
Great! I'm happy you got it working. To be honest with you though, the column names aren't case-sensitive, so your guess is as good as mine on why it started to magically work. lol Just for further information, your database/table names are case-sensitive if you're using a Unix/Linux system, and they're not case-sensitive if your database is running on Windows; works in the same way as their file systems in regards to case sensitivity. Columns/fields are NOT case sensitive in any situation.
15th Feb 2018, 5:27 PM
Fata1 Err0r
Fata1 Err0r - avatar