I have a table that holds records of grades of student, these students are in a group. some have 5 members some have 4, 3 or 2. The page where grades can be edited returns all the names of the group selected with a textbox corresponding to each of them. this is the part of my code that returns the
Tag: mysql
MySQLi Select to PHP variable
I wrote a PHP script with a database connection, which appears to work properly. The problem I’m having is in using a SELECT statement to fetch values from my database and assign those values to PHP variables. This is my table: If I copy the SQL into PHPMyAdmin, I get the right result, so I trust the qu…
Inserting date in PHP prepared statements
I am trying to insert current date (in d-m-Y) in a prepared statement into mysql table. I can’t get the code right. I am calling current date in php by and then including in a prepared statement like this In the table, the date does not get inserted. It remains 0000-00-00. How can I rectify this? Answer…
Interpreting mysqldumpslow results
I have modified mysql config to log slow queries And interpreting them with mysqldumpslow. One of the results is as follows Question: what do the numbers in brackets mean? The query does take about 0.21s when run with mysql (or via mysql GUI’s); however when making a request to a page the time span is m…
how to reduce image size or quality to specific size when upload
in a PHP query form i’m trying to set limit for the image size whenever user upload any size of image automatically reduces to a specific size. i don’t have any idea, so give me some suggestion to do …
Displaying BLOB image from Mysql database into dynamic div in html
I have a BLOB image that is stored when the user submits an advert form, they have the choice of uploading one image. The image is stored in the database with the other information. Every time my page loads it dynamically creates the advert divs and also fills in the matching information from my database into…
How do I get a list of all models in Laravel?
I would like to find a list of all models, database tables as a backup, in a Laravel project. I want to do this to build a dashboard that displays the way data in all of the models has changed over time, I.E. if there is a user model, how many users have been added or modified each day for
How to show PHP Duplicate Entry error message on current page
I am creating a signup form for a website I am developing. I am using PHP to insert the form into my database. I have the useremail set as a Unique Key in my database. When I type in an email that already exists in my database it brings me to a blank page with this error message: Duplicate entry
Access denied for user ‘root’@’localhost’ (using password: YES) after resetting root password
I am getting this when trying to load a webpage that requires the mysql database. I had to go and recently reset the root password that was used for phpmyadmin. oops connection problem ! –> Access denied for user ‘root’@’localhost’ (using password: YES) All this is also runnin…
How to print the sql count in a view?
I have this But I don’t know how to print the result in a view ? Answer The select method will always return an array of results. To print the count: To print the result in a view you have to pass a variable: Then print the result in your view: To get more details about the database with Laravel,