This is driving me nuts...
Ever since the php version on my server has been upgraded to ver5 I get error_log files appearing in all my sites that use databases with pages of entries like this:
PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in...
Could be one for sql forum rather than php, so please feel free to move it...
I am writing a php script that modifies a mysql database which more than one person may be accessing simultaneously and I need to lock the table for a short time to stop anyone else making modifications at the same...
I'm still learning this stuff, so please bear with me...
I have a shopping cart which returns a variable on checkout completion containing the cart contents. The variable looks like this:
product1 : quantity1 : price1 ~ product2 : quantity2 : price2
ie: parameters for each item in the cart...
need some advice on the best way to make a search page in php for a mysql database.
The database contains 3 columns with CSV's. The CSV's are all taken from a set list of about 20 different values.
I want users to be able to search for each row for different values using dropdowns or...
I think this should be very simple, but I'm having problems as usual...
I want to build an array from checkboxes on a form. My form looks like this:
<input name="fruit1" type="checkbox" id="fruit1" value="apples" />
Apples
<input name="fruit2" type="checkbox" id="fruit2"...
I want to set an "initially selected" option for a drop down list to be the same as the data in a field from a database query. For example:
<select name="fruit" id="fruit">
<option value="apples">apples</option>
<option value="pears">pears</option>
</select>
If I query the database...
Trying to extract rows from a database where the renewal_date
is sooner than 30 days with this code:
//get todays date
$today = getdate();
//format date to the same format as "renewal_date" datestamp colummn in database ie YYYY-MM-DD - "mday" = day of month, "mon" = month, "year" = year...
Next question.....
If I try and send a field containing & to my database, it appears there as & and when I call it again, it also appears as &. To be valid html, I want it to be &. Apart from replacing each occurrence of & with & when I call the field, is there another way to do it?
Hello,
I am getting a lot of added backslashes in data that has been inserted and then modified and called from a database. When sending to the database I have been using mysql_real_escape_string. As I understand it, when I use this, backslashes will be inserted in front of quotes etc before...
Hello,
I am getting a lot of added backslashes in data that has been inserted and then modified and called from a database. When sending to the database I have been using mysql_real_escape_string. As I understand it, when I use this, backslashes will be inserted in front of quotes etc before...
When a new entry is added to a table, the timestamp is added with CURRENT_TIMESTAMP. I want to run a query to find all entries in the table that were added, say, 330 days ago or more. I can think of a very roundabout way of doing this, and know that there must be a simple way to do this, but...
I have a table with several columns that have repeated values. I want to select and list only the unique values from 2 columns and list them alternately.
This code works as expected to select unique vales from column 'listing_location' where area column is 'area1' and list them:
$query = "...
Hello,
I have a page for inserting data into an sql database with an html form. It looks a bit like this:
$SQL = " INSERT INTO listings ";
$SQL = $SQL . " (paid, business_category, businesscategory, business_name,....
$SQL = $SQL . "...
I have an SQL database that lists businesses details and includes a columns for location and business category.
Lets say, in "Townsville" there are 9 businesses - 4 hotels, 3 shops, 2 bars and no garages.
So hotel 1 will have column "business category" = hotel, "location" = townsville, "name"...
Can anybody see what the error is here please?
ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = 3' at line 1 UPDATE instructors SET course1 = 'Scottish Research Online', course2 = 'Scotland...
Help! I've designed a site - table free, W3C strict 1.0 compliant (well, it will be once I've tidied things up) and everything dispays fine in opera, ie 6 & 7, firefox, but in Netscape 7.1 the text in nearly all of the divs has moved to start at the top left of the page aaaggggghhhh...
I have a list of dates in a database where the months area displayed as 2 digit numbers. I want to extract them and print them as months (january etc) below is my attempt to do this, which seems to correct syntax and does something, but not quite what I expected (the months all come back as...
could someone please explain this error. It's driving me nuts - I just can't see what's wrong with the query
SQL query:
UPDATE coursedescriptions SET coursenumber = '333',
coursetitle = 'ctitle 6 mod',
coursedescription = 'description 6',
instructor = 'sssssssssss',
courseoutline1 =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.