GOT IT! Thanks! The query, on occasion was coming up:
The query run was: SELECT full FROM coursepwds WHERE courseid = 2332013T.B.A.
Those .'s shouldn't be there...
For the future, is there any way that I can get PHP to write more error details to the log file to help diagnose problems without...
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...
Thanks for that and the tip about explode.
Before I start testing this, from what I can see, if I run your code on the following cart contents:
product1 : quantity1 : price1 ~ product2 : quantity2 : price2
I'll get
$Products[0] = "product1"
$Products[1] = "quantity1"
$Products[2] = "price1"...
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...
I know - the database should be normalised, but I didn't write it, so please give me a break....
It would take forever to do it and I need a quick fix for now. And I've found it: FIND_IN_SET is the function I'm after.
yes, I realise that the CSV,s are making things more complicated and that changing the structure of the database will be the best solution in the long term, but that will involve a *lot* of work.
I think I'm getting there with check boxes, but won't post anything yet as it's still in progress...
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...
Thanks for this and the point about register_globals.
I changed my code to make my post simple. What I actually want to do is put the array into a database as a single string 'apples, pears', so I need to make the arrays into a single string.... "imlode" I think, but I'm not getting the results...
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"...
Thank you. That does the job.
I was hoping there might be a slightly less long winded way to do it as I have a bit more than apples and pears, but I guess not.
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?
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.