Skip to content

Tag: mysql

php table update multiple records at one time

I have a table that retrieves the username and availability status from the users table. Right now in my testing database I have 3 records. If I try to change the availability field for any of them, noting in updated. This is my availability.php file (the first line keeps getting cut off): Here is my av_updat…

Random peaks in Mysql load slowing all users

We have a site that has been working pretty well for the past 2 years. But we are actually seeing random peaks in the database load that make the site very slow for a few seconds. These peaks only appear from a certain load on the server and are impossible to predict. More users = more peaks. Everything run v…

How to check if all mysql results are equal

I’m facing a difficulty at the moment – I’m working on a real-estate website where the seller has some developments which have individual units within each development (a house with 4 apartments, for example). The development has a status column in the database which specifies if it is Avail…

Two or more SQL queries in PHP function

Learning a graph-building PHP script I met a situation when PHP function performs only first query. Original code ALL OK, everything works, I have a pie graph with correct data. But when I add one more query to update data before further processing this case the function performs only first query adding +1 to…

My index.html PHP page will not load when my login code is present

I watched a tutorial to build out a registration / login page. The register.php page works fine and writes new users to my mysql database. The index.html page will not load at all for data entry as written (but doesn’t give me a specific error). I have checked it against the tutorial. I ran the code thr…

Display related posts from the same category. Using PHP and MySQL

I have a blog site in PHP and MySQL with tow table, POST and CATEGORIES. I need help, how to display related post from same category when visitor clicked on a single post title. your help will be greatly appreciated POST table POST_ID CAT_ID TITLE DESCRIPTION IMAGE 1 3 2 5 3 1 4 6 CATEGORIES table Cat_id Cat_…

How to fetch values for every id present in array using loop

I have an array with following values: and a table ‘orderdetails’ in database with order_title and order_id columns. What I want is to fetch order_title of every order using order_id in a loop. Can anyone help? What I know is: but this will make query run multiple times, any better solution? UPDAT…