![]() |
|
[PHP] Echo in while loop problem - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183) +---- Thread: [PHP] Echo in while loop problem (/showthread.php?tid=5942164) |
Echo in while loop problem - blackcoder00 - Feb 17, 2019 hi guys i need help in this script the problem is : in the first statment the script insert the values without error but after inserting he don't print the new values what are the mistakes i made guys ? PHP Code PHP Code RE: Echo in while loop problem - Abruptum - Feb 17, 2019 (Feb 17, 2019 03:25 PM)blackcoder00 Wrote: hi guys i need help in this script the problem is : Pleas for gods sake use mysqli+prepared statments your code quality is terrible... Your problem lies in the logic of the inserting. Steps you do: 1. request all clients with firstname x 2. check if there is one 3. you detect that its a new user 4. you insert a new user to the table 5. You then check for the result if teh adding was successful. 6. Now you go through the loop of gathered old users but you allready detected in the step 2-3 that there is no user .... So you need to reload the users from teh database or do the work with your data you have loaded. This is a Better Solution: PHP Code |