Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

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