|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Link Referral System
Here is my problem:
I am creating a links system with a hits system (in and out). The links are created wonderfully, and the "out" url (?p=referout&id=whatever) is created appropriately. But the "In" url (?p=referin&id=whatever) is always wrong: "id" is always assigned to "1", so it only updates the "in" hits for the first link inserted into the database. I am wondering how to make it assign the correct ID number for each "in" url (?p=referin&id=CORRECT#!!!!). Here are the scripts for the following files: add_link.php links.php referin.php add_link.php PHP Code:
links.php PHP Code:
referin.php PHP Code:
Please browse through them and let me know why it might assign the id "1" for all of them! Thanks -Yaggles |
|
#2
|
|||
|
|||
|
These lines:
PHP Code:
Always return the id of the 1st (I mean topmost in the returned recordset) row. To return the id of the most recently inserted row you could e.g. make your id field something like Code:
id INT AUTO_INCREMENT PRIMARY KEY in the CREATE TABLE syntax and use e.g. the line (not checked): PHP Code:
instead of PHP Code:
__________________
PHP Programmer |
|
#4
|
|||
|
|||
|
Oh... Sorry!!! there was a spamming post in the thread (probably will be deleted by the moderators shortly), after which the thread got to the top. And I answered without looking at the date of the original post.
Will have to pay more attention in the future. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Link Referral System |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|