#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Toronto, Ontario, Canada
    Posts
    19
    Rep Power
    0
    Is it possible to have a feild in a table auto increment each time a PHP script does a query to the database then displays the result and the link gets clicked?
    I am aware of the auto increment function in MySQL but I am not sure how to pass the paramters from from PHP to MySQL to increment the feild.
    Any help or pointers in terms of documentation would be greatly apreciated all I need is a starting point.

    Thanks to all who took the time to at least look at my post!
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    19
    Rep Power
    0
    If your "query" means "select" it's impossible to perform this action for the time of one transaction neither in MySQL nor in MS SQLServer nor in Oracle yet. In case your query is "update or delete" MySQL can't do an auto increment at the same time also. It doesn't have the mechanism of triggers. You need to write 2 different SQL statements in your script firstly to query a database and update special field in some table (and probably to make another query to get meaning of this field).

Similar Threads

  1. Replies: 4
    Last Post: January 6th, 2004, 04:56 PM
  2. PHP hit counter & sessions problem
    By irishairpics in forum PHP Development
    Replies: 11
    Last Post: September 23rd, 2003, 08:00 AM
  3. MySQL hit counter
    By mbritton72 in forum PHP Development
    Replies: 3
    Last Post: May 13th, 2002, 07:32 PM
  4. Uknow Known MYSQLERROR
    By andyw in forum MySQL Help
    Replies: 7
    Last Post: January 23rd, 2001, 10:34 AM
  5. incrementing a counter via php
    By thecrazed1 in forum PHP Development
    Replies: 8
    Last Post: September 18th, 2000, 10:35 AM

IMN logo majestic logo threadwatch logo seochat tools logo