Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,232 members, 7,811,645 topics. Date: Sunday, 28 April 2024 at 04:29 PM

Please Help Php/mysql - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Please Help Php/mysql (1274 Views)

Php/mysql Pin And Serial Number Generation Script / Wamp Server Ebook Ft Install Wamp, Write Php / Mysql / Mysql Console / Learn Cakephp, Php/mysql For Free With Video Tutorials (2) (3) (4)

(1) (Reply) (Go Down)

Please Help Php/mysql by Dawgzfada(m): 3:23pm On Jul 01, 2011
Am working on the registration page of a webapp and i need the query statement i'll be using for the "testcode" parameter i.e. if the code exists in the database, then it should register, else fail.

The way it was inserted is

$query = "update test set testname='" . htmlspecialchars($_REQUEST['testname'], ENT_QUOTES) . "',testdesc='" . htmlspecialchars($_REQUEST['testdesc'], ENT_QUOTES) . "',subid=" . htmlspecialchars($_REQUEST['subject'], ENT_QUOTES) . ",testfrom='" . $fromtime . "',testto='" . $totime . "',duration=" . htmlspecialchars($_REQUEST['duration'], ENT_QUOTES) . ",totalquestions=" . htmlspecialchars($_REQUEST['totalqn'], ENT_QUOTES) . ",testcode=ENCODE('" . htmlspecialchars($_REQUEST['testcode'], ENT_QUOTES) . "','oespass') where testid=" . $_REQUEST['testid'] . ";";

I tried


$result=executeQuery("select testcode from test where testcode=DECODE('" . htmlspecialchars($_REQUEST['testcode'], ENT_QUOTES) . "';"wink;
if(mysql_num_rows($result1) != 0)
    {
        $_GLOBALS['message']="Sorry the Testcode doesn't exist.";
    }
else
{
//Register
}


but it didn't work.

Someone should please help. Thanks
Re: Please Help Php/mysql by joomlaman(m): 4:37pm On Jul 01, 2011
Hmm! let me finish eating tongue and concentrate to solve your problem soon!
Re: Please Help Php/mysql by Dawgzfada(m): 4:42pm On Jul 01, 2011
Thank you. .

Lemme simplify the problem now, the main problem is in this line, around that decode line.

$result=executeQuery("select testcode from test where testcode=DECODE('" . htmlspecialchars($_REQUEST['testcode'], ENT_QUOTES) . "';"wink;


I want it to encode the user's input. .and check against what i have in my db.
Re: Please Help Php/mysql by Mobinga: 5:51pm On Jul 01, 2011
Re: Please Help Php/mysql by Nobody: 12:11am On Jul 02, 2011
I can see you didn't close your quote properly. Look at your lines they are not in accordance with what you want them to do for you. Just look closely you will see what the errors are.
Re: Please Help Php/mysql by Dawgzfada(m): 7:16am On Jul 02, 2011
Thanks for all the efforts. Solved already.
Re: Please Help Php/mysql by DualCore1: 7:28am On Jul 02, 2011
Post the solution, to help someone someday.

(1) (Reply)

Glo Tweakfor Free Browsing / Tips On How To Promote Your Blog Free Of Charge. / Pls How Reliable Is Www.obewesms.com

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 16
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.