Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Web-based username and password retrieval PHP and MYSQL

  • 28-01-2007 11:58PM
    #1
    Closed Accounts Posts: 857 ✭✭✭


    I am a toal noob at PHP and MySQL and today i set up a system whereby a person purchases a username and password from me. I have this running smoothly now using Paypal IPN and a nice script.

    The problem is, even though I have it emailing the username and password and also displaying on the return webpage, I want to set up a retrieval system, so if for example somebody has access to a server and dont use it for a while, they can go to a page on my site and type in either their Paypal email address or the unique Paypal transaction ID and hit submit and it will display the details

    So far, I have it almost there. Using the delivery script, I sent some usernames and passwords to myself for testing. When I use phpMyAdmin, I see the "transaction id's" in the correct position. I then go to my query page, type in this transaction id and hey presto, it shows me my username and password, so for a total noob, I was well chuffed!!

    That is of course, until now, when I got a REAL sale through Paypal and the delivery etc went perfect, so I grabbed the Paypal transaction ID and typed it into my retrieval pageand hit submit and all I get is

    Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /xxxx/xxxx/xxxx/xxxxx.php3 on line 20
    There Were No Results for Your Search


    Anybody have any ideas?? Even tell me what you need to see. I can paste the above php contents here etc.

    Look forward to hearing from somebody who actually "knows" what they are doing!! :D


Comments

  • Registered Users, Registered Users 2 Posts: 1,086 ✭✭✭Peter B


    Looks like the the query contains an error. If you use mysql_num_rows($result) function it will say there is an error if the "$result" is not valid and an error has been produced.

    I often echo the sql query if there is an error just to be sure. Then I paste this error into phpmyadmin to confirm it does not work there also. Make sure you hide this when you are happy it is working properly just for security reasons.

    If these transaction ID contain any characters which need to be escaped it is best to use the mysql_real_escape_string($variable) function.


Advertisement