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...
...on line 278
I never had these warnings before the php upgrade. And here's what's on line 35 of xxxx.php:
29>> $SQL = " SELECT * FROM coursedescriptions WHERE coursenumber = '$coursenumber'";
30>> $retid = mysql_query($SQL);
31>> if (!$retid) { echo( mysql_error()); }
32>>
33>>
34>>
35>>...
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.
...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.
But I've come up against...
...green"
column c = "wood, stone, water"
so a user might want to find a row with columns a, b or c containing ALL of apples, oranges, red and stone **OR** ANY of apples, oranges, red and stone (preferably in the latter case sorted by the number of matched occurrences).
I'm familiar with the...
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.