www.webdeveloper.com
Results 1 to 9 of 9

Thread: Update MySQL row using URL link?

  1. #1
    Join Date
    Feb 2003
    Posts
    70

    Update MySQL row using URL link?

    I currently update MySQL rows using phpMyAdmin. For example:

    UPDATE mysql_db SET publish = 1 WHERE Date = 'Sunday, August 15, 2004 21:04:32'

    Since I get the update info in an e-mail send whenever the form is submitted, I'd like to turn querys like the above encoded into a URL - bypassing phpMyAdmin - which when clicked, will update the row.

    Anybody know how to do this?

    Many thanks in advance,

    -Bob

  2. #2
    Join Date
    Nov 2003
    Location
    Canada
    Posts
    1,592
    You would have to send it to a page that has the mysql_query() on it, then on the same page, get the referer and use a Location header to direct the browser back to the referer after the query has been executed.
    Windows XP SP2 - theme: Thallos
    AMD Athlon 64 X2 4600+ | ASUS M2N32-SLI Deluxe | 2 * 1024 PC2-6400 Mushkin DDR2-800 | eVGA GeForce 6800XT 256MB | Creative Sound Blaster X-FI Music
    5 * 320GB Seagate Barracuda SATA-II 3Gb/s in RAID 5 | Lite-On 16x DVD-RW | Mitsumi 7-in-1 Floppy drive and card reader
    Samsung SyncMaster 204B 20" TFT LCD | Logitech G15 Keyboard | Logitech G7 Mouse | Seasonic PC160SK Headset

  3. #3
    Join Date
    Feb 2003
    Posts
    70
    Wow! Thanks the quick reply Daniel :-)

    So I guess what I'm trying to do is not possible?? I read somewhere about using a ftp URL which would prompt/require the id/password authentication that I normally get when I want to access phpMyAdmin. I
    I've clicked on plenty of e-mail URLs which do something other than take me to a Web site, for example, like the lost password/reset link you get from Webdeveloper. Is what you describe similar to how that is done?

    Thanks again,

    -Bob

  4. #4
    Join Date
    Nov 2003
    Location
    Canada
    Posts
    1,592
    Originally posted by bobafifi
    I've clicked on plenty of e-mail URLs which do something other than take me to a Web site, for example, like the lost password/reset link you get from Webdeveloper. Is what you describe similar to how that is done?
    Yes, that would involve going to a page that uses mail() to mail the information and then use header("Location: blahblah.php") to forward you to a different page without you even knowing that the mail page existed.
    Windows XP SP2 - theme: Thallos
    AMD Athlon 64 X2 4600+ | ASUS M2N32-SLI Deluxe | 2 * 1024 PC2-6400 Mushkin DDR2-800 | eVGA GeForce 6800XT 256MB | Creative Sound Blaster X-FI Music
    5 * 320GB Seagate Barracuda SATA-II 3Gb/s in RAID 5 | Lite-On 16x DVD-RW | Mitsumi 7-in-1 Floppy drive and card reader
    Samsung SyncMaster 204B 20" TFT LCD | Logitech G15 Keyboard | Logitech G7 Mouse | Seasonic PC160SK Headset

  5. #5
    Join Date
    Feb 2003
    Posts
    70
    OK Daniel, - sounds like what I'm after is more involved than I was imagining - namely bypassing the phpMyAdmin biz in order to run an update query - can you recommend some resources for me to check out that covers this kind of thing?

    Thanks again,

    -Bob

  6. #6
    Join Date
    Nov 2003
    Location
    Canada
    Posts
    1,592
    A combination of these is what you're looking to do:

    http://ca3.php.net/mysql_query
    http://ca3.php.net/manual/en/functio...r.php#AEN39575
    Windows XP SP2 - theme: Thallos
    AMD Athlon 64 X2 4600+ | ASUS M2N32-SLI Deluxe | 2 * 1024 PC2-6400 Mushkin DDR2-800 | eVGA GeForce 6800XT 256MB | Creative Sound Blaster X-FI Music
    5 * 320GB Seagate Barracuda SATA-II 3Gb/s in RAID 5 | Lite-On 16x DVD-RW | Mitsumi 7-in-1 Floppy drive and card reader
    Samsung SyncMaster 204B 20" TFT LCD | Logitech G15 Keyboard | Logitech G7 Mouse | Seasonic PC160SK Headset

  7. #7
    Join Date
    Feb 2003
    Posts
    70
    Thanks Daniel - links look good.
    I don't know much about php (actually about any computer languages! - I'm a musician, not a programmer), - scripts I use are in Perl so that's what I've been looking for to do this.

    Thanks again for the help,

    -Bob

  8. #8
    Join Date
    Nov 2003
    Location
    Canada
    Posts
    1,592
    Oooh, I was thinking you were a programmer.... well, in that case, you could probably find a prewritten script out there somewhere.... you could give Matt's Script Archive a try.
    Windows XP SP2 - theme: Thallos
    AMD Athlon 64 X2 4600+ | ASUS M2N32-SLI Deluxe | 2 * 1024 PC2-6400 Mushkin DDR2-800 | eVGA GeForce 6800XT 256MB | Creative Sound Blaster X-FI Music
    5 * 320GB Seagate Barracuda SATA-II 3Gb/s in RAID 5 | Lite-On 16x DVD-RW | Mitsumi 7-in-1 Floppy drive and card reader
    Samsung SyncMaster 204B 20" TFT LCD | Logitech G15 Keyboard | Logitech G7 Mouse | Seasonic PC160SK Headset

  9. #9
    Join Date
    Feb 2003
    Posts
    70
    Hi Daniel,

    I just found this page ( http://www.aspfree.com/c/a/ASP/Make-...ML-with-VSNET/ )
    which looks very much like what I have in mind, but for MySQL (.

    "SELECT CustomerId, CompanyName FROM Customer"

    http://localhost/sql?sql=select%20Cu...R%20XML%20AUTO

    =====

    Would something like this work??

    Thanks,

    -Bob

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles