[PHP-DB] help newbies :)
Hello All, I am developing attendence mangement system, its my first application in PHP, I want to compaire the input text box value with table records the follwing is the code _index.htm___ .. form name = 'loginfrm' method = post action = index.php pre /td /tr tr td width=100% height=115html body div style=mso-border-alt: solid #FF .75pt; width: 675; height: 234; border: 1.0pt solid #FF; padding: 6.0pt; background: #FF table border=0 cellpadding=0 cellspacing=0 style=border-collapse: collapse bordercolor=#11 width=100% id=AutoNumber2 tr td width=25%font size=4User Name:/font/td td width=25% pinput name = uname type = text size=20/p /td td width=25%font size=4nbsp;nbsp;nbsp;nbsp; Class:/font/td td width=25% select name= class option value = BBA BBA/option option value = BBA-IT BBA-IT/option option value = BCS BCS/option option value = B.Sc B.Sc/option option value = MBA MBA/option option value = MBA-IT MBA-IT/option option value = MS-IT MS-IT/option option value = MS-CS MS-CS/option option value = Admin Admin/option /select /td td width=25%font size=4Password:/font/td td width=25%input name =passwd type = password size=20 /td etc. etc. ... _ _index.php_ ?php $db= mysql_connect(localhost,root,masood); mysql_select_db(attendence,$db); $result= mysql_query(select uname,upasswd from user,$db); while ($myrow = mysql_fetch_array($result)) { if(($uname == $myrow[uname]) ($upasswd == $myrow[uname])); { echo $myrow[uname]; echo $myrow[upasswd]; } } ? /body /html this give me error no 13, with uname,upasswd undefined, please help me out, TIA -- Nayyar Ahmad Lecturer Faculty Of Computer Science, Institute Of Management Sciences, Hayat Abad Peshawar , Pakistan. Office : 92-091-9217404 , 9217452 Cell : 92-0333-9139461 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] help newbies :)
On Thu, 23 Dec 2004 10:57:55 -0500, Bastien Koert [EMAIL PROTECTED] wrote: you have a mysql account with that particular user identification? yes this connections works well when i query table user, in specified db. bastien From: Nayyar Ahmed [EMAIL PROTECTED] Reply-To: Nayyar Ahmed [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] help newbies :) Date: Thu, 23 Dec 2004 20:54:23 +0500 Hello All, I am developing attendence mangement system, its my first application in PHP, I want to compaire the input text box value with table records the follwing is the code _index.htm___ .. form name = 'loginfrm' method = post action = index.php pre /td /tr tr td width=100% height=115html body div style=mso-border-alt: solid #FF .75pt; width: 675; height: 234; border: 1.0pt solid #FF; padding: 6.0pt; background: #FF table border=0 cellpadding=0 cellspacing=0 style=border-collapse: collapse bordercolor=#11 width=100% id=AutoNumber2 tr td width=25%font size=4User Name:/font/td td width=25% pinput name = uname type = text size=20/p /td td width=25%font size=4 Class:/font/td td width=25% select name= class option value = BBA BBA/option option value = BBA-IT BBA-IT/option option value = BCS BCS/option option value = B.Sc B.Sc/option option value = MBA MBA/option option value = MBA-IT MBA-IT/option option value = MS-IT MS-IT/option option value = MS-CS MS-CS/option option value = Admin Admin/option /select /td td width=25%font size=4Password:/font/td td width=25%input name =passwd type = password size=20 /td etc. etc. ... _ _index.php_ ?php $db= mysql_connect(localhost,root,masood); mysql_select_db(attendence,$db); $result= mysql_query(select uname,upasswd from user,$db); while ($myrow = mysql_fetch_array($result)) { if(($uname == $myrow[uname]) ($upasswd == $myrow[uname])); { echo $myrow[uname]; echo $myrow[upasswd]; } } ? /body /html this give me error no 13, with uname,upasswd undefined, please help me out, TIA -- Nayyar Ahmad Lecturer Faculty Of Computer Science, Institute Of Management Sciences, Hayat Abad Peshawar , Pakistan. Office : 92-091-9217404 , 9217452 Cell : 92-0333-9139461 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Nayyar Ahmad Lecturer Faculty Of Computer Science, Institute Of Management Sciences, Hayat Abad Peshawar , Pakistan. Office : 92-091-9217404 , 9217452 Cell : 92-0333-9139461 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] help newbies :)
you have a mysql account with that particular user identification? bastien From: Nayyar Ahmed [EMAIL PROTECTED] Reply-To: Nayyar Ahmed [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] help newbies :) Date: Thu, 23 Dec 2004 20:54:23 +0500 Hello All, I am developing attendence mangement system, its my first application in PHP, I want to compaire the input text box value with table records the follwing is the code _index.htm___ .. form name = 'loginfrm' method = post action = index.php pre /td /tr tr td width=100% height=115html body div style=mso-border-alt: solid #FF .75pt; width: 675; height: 234; border: 1.0pt solid #FF; padding: 6.0pt; background: #FF table border=0 cellpadding=0 cellspacing=0 style=border-collapse: collapse bordercolor=#11 width=100% id=AutoNumber2 tr td width=25%font size=4User Name:/font/td td width=25% pinput name = uname type = text size=20/p /td td width=25%font size=4nbsp;nbsp;nbsp;nbsp; Class:/font/td td width=25% select name= class option value = BBA BBA/option option value = BBA-IT BBA-IT/option option value = BCS BCS/option option value = B.Sc B.Sc/option option value = MBA MBA/option option value = MBA-IT MBA-IT/option option value = MS-IT MS-IT/option option value = MS-CS MS-CS/option option value = Admin Admin/option /select /td td width=25%font size=4Password:/font/td td width=25%input name =passwd type = password size=20 /td etc. etc. ... _ _index.php_ ?php $db= mysql_connect(localhost,root,masood); mysql_select_db(attendence,$db); $result= mysql_query(select uname,upasswd from user,$db); while ($myrow = mysql_fetch_array($result)) { if(($uname == $myrow[uname]) ($upasswd == $myrow[uname])); { echo $myrow[uname]; echo $myrow[upasswd]; } } ? /body /html this give me error no 13, with uname,upasswd undefined, please help me out, TIA -- Nayyar Ahmad Lecturer Faculty Of Computer Science, Institute Of Management Sciences, Hayat Abad Peshawar , Pakistan. Office : 92-091-9217404 , 9217452 Cell : 92-0333-9139461 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] help newbies :)
Nayyar Ahmed wrote: Hello All, I am developing attendence mangement system, its my first application in PHP, I want to compaire the input text box value with table records the follwing is the code _index.htm___ .. form name = 'loginfrm' method = post action = index.php pre /td /tr tr td width=100% height=115html body div style=mso-border-alt: solid #FF .75pt; width: 675; height: 234; border: 1.0pt solid #FF; padding: 6.0pt; background: #FF table border=0 cellpadding=0 cellspacing=0 style=border-collapse: collapse bordercolor=#11 width=100% id=AutoNumber2 tr td width=25%font size=4User Name:/font/td td width=25% pinput name = uname type = text size=20/p /td td width=25%font size=4nbsp;nbsp;nbsp;nbsp; Class:/font/td td width=25% select name= class option value = BBA BBA/option option value = BBA-IT BBA-IT/option option value = BCS BCS/option option value = B.Sc B.Sc/option option value = MBA MBA/option option value = MBA-IT MBA-IT/option option value = MS-IT MS-IT/option option value = MS-CS MS-CS/option option value = Admin Admin/option /select /td td width=25%font size=4Password:/font/td td width=25%input name =passwd type = password size=20 /td etc. etc. ... _ _index.php_ ?php $db= mysql_connect(localhost,root,masood); mysql_select_db(attendence,$db); $result= mysql_query(select uname,upasswd from user,$db); while ($myrow = mysql_fetch_array($result)) { if(($uname == $myrow[uname]) ($upasswd == $myrow[uname])); firstly the preceeding line should probably be: if(($uname == $myrow[uname]) ($upasswd == $myrow[upasswd])); { echo $myrow[uname]; echo $myrow[upasswd]; } } ? /body /html this give me error no 13, with uname,upasswd undefined, please help me out, TIA get familiar with the var_dump() and print_r() functions. for instance what does the following output: $result= mysql_query(select * from user,$db); while ($myrow = mysql_fetch_array($result)) { print_r( $myrow ); } are the indexes 'uname' and 'upasswd' defined in each dumped array? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php