Full error message: Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ” at line 1 in C:\xampp\htdocs\bravolearning\edit.php:65 Stack trace: #0 ...
databaseanswers.net Latest Questions
I’m writing an app that allows to rank (vote) among several options. If an user from the Internet (not signed into the app) votes, I just store it with a user_id = NULL, but if some authenticated user votes, I ...
I am learning to use prepared statements to add security against SQL injections… I have written the below code and am looking for feedback on if the code is correct/secure. $user= mysqli_real_escape_string($conn, $_GET['user']); $sql = "SELECT user_name, about, avatar FROM users WHERE ...
I’m trying to put in text fields these values via a $_GET method, then pass this data into another website and see them in the text fields. Here is the data I want to pass: enter ...
Consider the database stock value of number 090 is 5, the code should run and update stock as 0 and echo running. if the stock value if 4 or less it should update nothing and display stopped. If the stock ...
I’m very new to SQL and I’ve been working on this code for days and I can’t get it to work… I ended up directly copying the code from w3schools but it still says "Fatal error: Uncaught Error: Call to a ...
I need to write query in sql Or Laravel. my matches table user_id and to_user_id match with user table. My Matches Table id user_id to_user_id 1 101 110 2 101
I’m trying to update my database with information from a form. But the data won’t register in the database when I click the button. It will change location to header but the info in the database won’t get updated. <?php include 'dbh.inc.php'; $id ...
Currently trying to seed the database with a lot of data. It’s very possible that I will get the same record twice so I thought to use firstOrCreate to make sure I don’t try to save it again with the ...
I use this code to insert or update the race_id on webpage_race table. Every time I use it I become a new new auto-increment ID. How can I stop it? <?php foreach($race_obj as $key => $race_value){ if(!empty($race_value->race_id)){$race_id = $race_value->race_id;}else{$race_id ...