Forum: PHP 1 Day Ago |
| Replies: 4 Views: 221 wow! thanks for all your time!!
Iv had a look at the script and it looks exactly what i needed, but im finding it a bit difficult to execute. can you give me an example of how to run it? like... |
Forum: PHP 4 Days Ago |
| Replies: 4 Views: 221 okay so this is the shape of the directory:
domain.com/branch_finder/country/county/branch
I have lots of pages like this so 3 examples would be:
... |
Forum: PHP 5 Days Ago |
| Replies: 4 Views: 221 Hi all,
I have a very large amount of files I need to update, so I thought the easiest way would be to do it with php.
Below is the current directory structure
... |
Forum: PHP 12 Days Ago |
| Replies: 8 Views: 258 surely just saving the login timestamp updating it every time the page is refreshed and then querying for users where the timestamp is less than x minutes ago are online would be the best answer? |
Forum: PHP 12 Days Ago |
| Replies: 3 Views: 315 yes post code please.
without seeing the code i think you have two options:
If you have access to the first action page (before paypal) then add this at the very end of the script (before any... |
Forum: PHP Mar 3rd, 2009 |
| Replies: 10 Views: 2,339 Heyy,
Thanks for the reply, your answer makes sense and seems very logical. I entered the following code in the phpmyadmin code tester:
SELECT * FROM images WHERE fbid IN (SELECT fbid FROM... |
Forum: PHP Mar 2nd, 2009 |
| Replies: 10 Views: 2,339 each photo is saved in the table images with FBID as the primary key.
Then ratings are saved in the ratings table and FBID refers to the photo the rating is about.
I want to only use photos... |
Forum: PHP Mar 1st, 2009 |
| Replies: 10 Views: 2,339 I dont think I can explain it easily.
I basically want to encapsulate this:
$get_photos = mysql_query('SELECT * FROM images');//get all photos
while($photos = mysql_fetch_array($get_photos)... |
Forum: PHP Feb 28th, 2009 |
| Replies: 9 Views: 608 mysql_query("DELETE FROM user_notifications WHERE username='".$acc."' AND notification='".$note2."' ");
that should be fine. if its not, try checking your $acc and $note2 variables... |
Forum: PHP Feb 28th, 2009 |
| Replies: 10 Views: 2,339 Hi all,
I need to do a query like this:
SELECT * FROM table1 WHERE ( SELECT COUNT(*) FROM table2 WHERE fbid = *current primaryKey*) > 150
How do I get the *current primaryKey* in order to do... |
Forum: PHP Jan 28th, 2009 |
| Replies: 8 Views: 717 Thanks for all the replies, I can tell that in future ill be referring to all this info, so thanks :)
Iv gone with floatval(), it seems like the simplest and at the moment does exactly what I... |
Forum: PHP Jan 28th, 2009 |
| Replies: 8 Views: 717 okay, so if I wanted to echo 10.000 as 10, I would have to just shave off the appended 0's?
How would I do this? Can anybody post a simple script to remove the appended 0's?
Max |
Forum: PHP Jan 28th, 2009 |
| Replies: 8 Views: 717 I have tried decimal, but it always adds 0's onto the end of my number.
I want it to only add the exact number I enter in, so for example at the moment if i enter in 10, it changes it to 10.000... |
Forum: PHP Jan 27th, 2009 |
| Replies: 8 Views: 717 Hi all,
I need to save a number to 3 decimal points, however I want 10.3 to be saved like this:
10.3
not this:
10.300 |
Forum: PHP Jan 24th, 2009 |
| Replies: 1 Views: 569 ****************SOLVED****************
silly mistake, the column `rating` was a varchar, and so when sorting by rating, it treated 10 as being lower than 9. Iv changed it to integer and it works... |
Forum: PHP Jan 24th, 2009 |
| Replies: 1 Views: 569 Hi,
Im having a wierd problem with my mysql query:
I have entries in my database with a rating (out of 10) and a timestamp, and I want to pull out the highest rated entry from the past 30 days.... |
Forum: PHP Nov 9th, 2008 |
| Replies: 1 Views: 403 dont worry, iv figured it out. Do something like this:
explode the cart into an array.
foreach($cart as $pid)
{
if the pid is in the array, do nothing
else: use substr_count to get the QTY ... |
Forum: PHP Nov 9th, 2008 |
| Replies: 1 Views: 403 Hi all,
I have a shopping basket feature on my website which saves the product's primary key in the session array called 'cart', each one seperated by a comma, so example: '123,456,789'.
Now in... |
Forum: PHP Oct 24th, 2008 |
| Replies: 2 Views: 907 ahh fantastic, thanks for the script. I think I just dived in head first without trying to understand whats happening where first which is why my variables were so scrambled.
just incase anybody... |
Forum: PHP Oct 24th, 2008 |
| Replies: 2 Views: 907 Hi all!
Im making an upload script that uploads an image file, saves it and saves a thumbnail copy in a different directory.
I have tried a couple of scripts and have found one which I think... |
Forum: PHP Oct 23rd, 2008 |
| Replies: 4 Views: 437 okay thanks. I only need to check to see if a single PID is saved inside the cookie so will this work:
if (eregi($pid, $_COOKIE['RATED_PRODUCTS']))
{
echo 'you have already rated';
}
else... |
Forum: PHP Oct 22nd, 2008 |
| Replies: 4 Views: 437 so each PID would be seperated by a ':' and to check if the user has already rated it I would have to search for the PID within the value of the cookie?
How long can the cookie value be anyway?
... |
Forum: PHP Oct 22nd, 2008 |
| Replies: 4 Views: 437 hii all,
I have a 5 star rating system which writes a cookie as the following when the user rates a product:
$pid = $_GET['pid']; //product ID (primary key)
$ratepostpone = 300; //5 minutes... |
Forum: PHP Oct 21st, 2008 |
| Replies: 3 Views: 440 okay, thanks for the advice sDJH and jbennet, I think ill go for the cookie option and use the product ID number (primary key) as the cookie name and ise php's isset function.
Thanks again :) |
Forum: PHP Oct 21st, 2008 |
| Replies: 3 Views: 440 Hi all,
Iv made a simple 5 star voting system and need a way to make sure the user can't vote on the same product again in the next hour.
I'm not a mathmatician and get really confused with the... |
Forum: PHP Oct 20th, 2008 |
| Replies: 3 Views: 1,486 Sorted. its probs not the most efficient code but it works. :)
$q = $_GET['q'];
//bit of sanitizing
$qtrim = strtolower($q);
$qtrim = stripslashes($q);
$qtrim = strip_tags($q); |
Forum: PHP Oct 20th, 2008 |
| Replies: 3 Views: 1,486 I want to return all results with EITHER john OR smith in.
Also the query needs to be dynamic, i.e. accept more than 1 / 2 words.
Thanks :) |
Forum: PHP Oct 20th, 2008 |
| Replies: 3 Views: 1,486 Hi all,
Iv looked at quite a lot of forums and cannot get the code to work properly for searching multiple search terms. I have tried exploding the search string and then doing a search similar to... |
Forum: PHP Oct 19th, 2008 |
| Replies: 3 Views: 1,255 damn. okay thanks anyway :) |
Forum: PHP Oct 18th, 2008 |
| Replies: 3 Views: 1,255 hi all,
I'm using dreamweaver templates to make my site, however when I want to use the session_start(); function in php, the headers have already been sent because dreamweaver writes the... |
Forum: PHP Oct 8th, 2008 |
| Replies: 15 Views: 1,693 |
Forum: PHP Oct 8th, 2008 |
| Replies: 15 Views: 1,693 Iv solved it:
save all votes in a longtext field in the database with each number seperated with a comma and use the script below to average the score to the nearest whole number:
#set rating... |
Forum: PHP Oct 7th, 2008 |
| Replies: 15 Views: 1,693 oh! I didnt realise you could change the type to medium int to increase the limit. I thought it had a 255 character limit. Well thats fine then :) You learn something everyday.
Okay so ill save... |
Forum: PHP Oct 6th, 2008 |
| Replies: 15 Views: 1,693 Yes I see what you mean. So I would need to store every vote in a database.
I was thinking something similar to this might work:
$pid = $_GET['pid'];
$newrating = $_GET['rating'];
... |
Forum: PHP Oct 6th, 2008 |
| Replies: 15 Views: 1,693 okay, thanks a lot. reply when you have time :) |
Forum: PHP Oct 6th, 2008 |
| Replies: 15 Views: 1,693 okay all the images and rollover's are sorted out now. it was just a simple mistake with the php script. try rating an item as 5 star about 5 times and eventually you will see the new rating on the... |
Forum: PHP Oct 6th, 2008 |
| Replies: 15 Views: 1,693 |
Forum: PHP Oct 6th, 2008 |
| Replies: 15 Views: 1,693 i got the mysql_query code from phpmyadmin and just left it as is. pid is my primary key so i can take it out..
iv just tried taking out the limit and it still has a problem. Here is a link to a... |