Jump to content

seems to a problem with a mysql query!


newbiez

Recommended Posts

:confused: :confused: thankyou for your time

 

There seems to  be a problem with a mysql query!

 

"); } else{ if(mysql_num_rows($r1) == '1'){ //mun = Merchant User Name $_SESSION['mun'] = $MyUsername1; @header("location:opentng.php"); exit(); }} ?>

<?
require_once("../conn.php");
$MyError = 'version 1.10';
if(@$_GET['cmd'] == 's2'){
$MyUsername1 = strip_tags($_POST['username1']);
$MyPassword1 = strip_tags($_POST['password1']);

if(empty($MyUsername1) || empty($MyPassword1)){
$MyError = '<font color="red" size="1" face="verdana">Both fields are required!</font>';
}
elseif(strlen($MyUsername1) < 4){
$MyError = '<font color="red" size="1" face="verdana">Username must be 4-20 alphanumeric characters.</font>';
}
elseif(strlen($MyPassword1) < 4){
$MyError = '<font color="red" size="1" face="verdana">Password must be 4-20 alphanumeric characters.</font>';
}
else{
//check the login info if exists
$MyPassword5 = md5($MyPassword1);
$q1 = "select * from pc_settings where AdminID = '$MyUsername1' and AdminPass = '$MyPassword5' ";
$r1 = mysql_query($q1);
$a1 = mysql_fetch_array($r1);

if($MyUsername1 != $a1['AdminID'] && $MyPassword1 != $a1['AdminPass']){
$MyError = '<font color="red" size="1" face="verdana">Incorrect Username or Password.</font>';
}
elseif(!$r1){
exit("<center>There seems to be  a problem with a mysql query!</center>");
}
else{
if(mysql_num_rows($r1) == '1'){
//mun = Merchant User Name
$_SESSION['mun'] = $MyUsername1;
@header("location:opentng.php");
exit();
}}
}}
?>
<html>
<head>
<title>Administration Login</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style>
td {
font:normal 8pt verdana,tahoma,arial
}
.input {
border:#336699 1px solid;
background-color:#D4E8FF;
font:normal 8pt verdana,tahoma,arial
}
</style>
</head>
<body style="background-image:url('img_bin/bg.gif')" bgcolor="#FFFFFF" onLoad="document.f1.username1.focus()">
<br /><br /><br />
<table style="background-image:url('img_bin/login_box.gif')" align="center" cellpadding="0" cellspacing="0" width="400" height="250">
<tr>
<td>
<form method="post" action="login.php?cmd=s2" name="f1" style="margin-top: 45px">
<table align="center" width="300" border="0" cellpadding="3" cellspacing="0">
<tr><td colspan="2" style="color:#336699;font-size:13px" height="40"><b>Authorisation Required</b></td></td></tr>
<tr>
<td style="text-align: right; width: 30%">Username:</td>
<td style="text-align: left"><input type="text" class="input" name="username1" maxlength="20" /></td>
</tr>
<tr>
<td style="text-align: right">Password:</td>
<td style="text-align: left"><input type="password" name="password1" maxlength="20" class="input" /></td>
</tr>
<tr>
<td colspan="2" align="center"><?=$MyError?></td><td align=right><input type="image" src="img_bin/b_logon.gif" /> </td>
</tr>
</table>
</form>
</td></tr></table>
</body>
</html>

 

 

Link to comment
Share on other sites

what error is given.. use mysql_error(); to tell you why the query failed.

tbh your query appears to be fine so would suspect it's something else.

 

Until i know why mysql is complaining i cant help you with this, so once you get chance post the mysql_error() output.

 

Stuie

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.