|
It is currently Fri May 18, 2012 3:33 am
|
View unanswered posts | View active topics
| Author |
Message |
|
Leonidasphp
|
Post subject: I do not try yet but eched the query: Posted: Mon Apr 14, 2008 8:35 pm |
|
Joined: Sat Feb 26, 2005 12:36 am Posts: 305
|
I do not try yet but eched the query:
Code: UPDATE updateTable SET L='20.5', L7='12', M='31', M7='25.5', H='31', H7='27.5' WHERE cat='A'; UPDATE updateTable SET L='24', L7='13', M='32.5', M7='27.5', H='32.5', H7='28' WHERE cat='B1'; UPDATE updateTable SET L='24', L7='14.5', M='34', M7='29', H='34', H7='32.5' WHERE cat='B2'; UPDATE updateTable SET L='25.5', L7='16', M='34', M7='32.5', H='36', H7='34' WHERE cat='C'; UPDATE updateTable SET L='27.5', L7='16', M='39.5', M7='31', H='36', H7='34' WHERE cat='D'; UPDATE updateTable SET L='32.5', L7='19.5', M='44.5', M7='36', H='41', H7='36' WHERE cat='E'; UPDATE updateTable SET L='34', L7='22', M='46', M7='37.5', H='44.5', H7='37.5' WHERE cat='F'; UPDATE updateTable SET L='34', L7='27.5', M='46', M7='34', H='49.5', H7='44.5' WHERE cat='G'; UPDATE updateTable SET L='65', L7='58', M='77', M7='72', H='84', H7='72' WHERE cat='H'; UPDATE updateTable SET L='48', L7='36', M='58', M7='48', H='58', H7='51.5' WHERE cat='I'; UPDATE updateTable SET L='37.5', L7='29', M='51.5', M7='44.5', H='54.5', H7='48' WHERE cat='J'; UPDATE updateTable SET L='41', L7='32.5', M='54.5', M7='49.5', H='58', H7='54.5' WHERE cat='K1'; UPDATE updateTable SET L='44.5', L7='34', M='58', M7='53', H='61.5', H7='58' WHERE cat='K2'; UPDATE updateTable SET L='48', L7='44.5', M='65', M7='56.5', H='65', H7='61.5' WHERE cat='N'; UPDATE updateTable SET L='48', L7='44.5', M='58', M7='53', H='63', H7='60' WHERE cat='P'; UPDATE updateTable SET L='25.5', L7='22', M='29', M7='29', H='31', H7='29' WHERE cat='S';Unable to execute query. Please go back and retry.
|
|
| Top |
|
 |
|
Leonidasphp
|
Post subject: I try it , with echo appears Posted: Mon Apr 14, 2008 8:51 pm |
|
Joined: Sat Feb 26, 2005 12:36 am Posts: 305
|
I try it , with echo appears: (please note that when at beginning I run script withonly first statement from the 16 in the query succeeds) ?
Code: UPDATE updateTable SET L='20.5', L7='12', M='31', M7='25.5', H='31', H7='27.5' WHERE cat='A'; UPDATE updateTable SET L='24', L7='13', M='32.5', M7='27.5', H='32.5', H7='28' WHERE cat='B1'; UPDATE updateTable SET L='24', L7='14.5', M='34', M7='29', H='34', H7='32.5' WHERE cat='B2'; UPDATE updateTable SET L='25.5', L7='16', M='34', M7='32.5', H='36', H7='34' WHERE cat='C'; UPDATE updateTable SET L='27.5', L7='16', M='39.5', M7='31', H='36', H7='34' WHERE cat='D'; UPDATE updateTable SET L='32.5', L7='19.5', M='44.5', M7='36', H='41', H7='36' WHERE cat='E'; UPDATE updateTable SET L='34', L7='22', M='46', M7='37.5', H='44.5', H7='37.5' WHERE cat='F'; UPDATE updateTable SET L='34', L7='27.5', M='46', M7='34', H='49.5', H7='44.5' WHERE cat='G'; UPDATE updateTable SET L='65', L7='58', M='77', M7='72', H='84', H7='72' WHERE cat='H'; UPDATE updateTable SET L='48', L7='36', M='58', M7='48', H='58', H7='51.5' WHERE cat='I'; UPDATE updateTable SET L='37.5', L7='29', M='51.5', M7='44.5', H='54.5', H7='48' WHERE cat='J'; UPDATE updateTable SET L='41', L7='32.5', M='54.5', M7='49.5', H='58', H7='54.5' WHERE cat='K1'; UPDATE updateTable SET L='44.5', L7='34', M='58', M7='53', H='61.5', H7='58' WHERE cat='K2'; UPDATE updateTable SET L='48', L7='44.5', M='65', M7='56.5', H='65', H7='61.5' WHERE cat='N'; UPDATE updateTable SET L='48', L7='44.5', M='58', M7='53', H='63', H7='60' WHERE cat='P'; UPDATE updateTable SET L='25.5', L7='22', M='29', M7='29', H='31', H7='29' WHERE cat='S';You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; UPDATE updateTable SET L='24', L7='13', M='32.5', M7='27.5', H='32.5', H7='28'' at line 1 I use: Code: include("dbinfo.php"); $linkid = @mysql_connect($hostname,$username,$password) or die( "Unable to connect to Database Server. Please try again later."); @mysql_select_db($database,$linkid) or die( "Unable to select database. Please try again later,"); // @
$query = "UPDATE updateTable SET L='$aL', L7='$aL7', M='$aM', M7='$aM7', H='$aH', H7='$aH7' WHERE cat='A'; UPDATE updateTable SET L='$b1L', L7='$b1L7', M='$b1M', M7='$b1M7', H='$b1H', H7='$b1H7' WHERE cat='B1'; UPDATE updateTable SET L='$b2L', L7='$b2L7', M='$b2M', M7='$b2M7', H='$b2H', H7='$b2H7' WHERE cat='B2'; UPDATE updateTable SET L='$cL', L7='$cL7', M='$cM', M7='$cM7', H='$cH', H7='$cH7' WHERE cat='C'; UPDATE updateTable SET L='$dL', L7='$dL7', M='$dM', M7='$dM7', H='$dH', H7='$dH7' WHERE cat='D'; UPDATE updateTable SET L='$eL', L7='$eL7', M='$eM', M7='$eM7', H='$eH', H7='$eH7' WHERE cat='E'; UPDATE updateTable SET L='$fL', L7='$fL7', M='$fM', M7='$fM7', H='$fH', H7='$fH7' WHERE cat='F'; UPDATE updateTable SET L='$gL', L7='$gL7', M='$gM', M7='$gM7', H='$gH', H7='$gH7' WHERE cat='G'; UPDATE updateTable SET L='$hL', L7='$hL7', M='$hM', M7='$hM7', H='$hH', H7='$hH7' WHERE cat='H'; UPDATE updateTable SET L='$iL', L7='$iL7', M='$iM', M7='$iM7', H='$iH', H7='$iH7' WHERE cat='I'; "; $query .= "UPDATE updateTable SET L='$jL', L7='$jL7', M='$jM', M7='$jM7', H='$jH', H7='$jH7' WHERE cat='J'; UPDATE updateTable SET L='$k1L', L7='$k1L7', M='$k1M', M7='$k1M7', H='$k1H', H7='$k1H7' WHERE cat='K1'; UPDATE updateTable SET L='$k2L', L7='$k2L7', M='$k2M', M7='$k2M7', H='$k2H', H7='$k2H7' WHERE cat='K2'; UPDATE updateTable SET L='$nL', L7='$nL7', M='$nM', M7='$nM7', H='$nH', H7='$nH7' WHERE cat='N'; UPDATE updateTable SET L='$pL', L7='$pL7', M='$pM', M7='$pM7', H='$pH', H7='$pH7' WHERE cat='P'; UPDATE updateTable SET L='$sL', L7='$sL7', M='$sM', M7='$sM7', H='$sH', H7='$sH7' WHERE cat='S';"; // P499 echo $query; $result = mysql_query($query,$linkid) or die(mysql_error()); //("Unable to execute query. Please go back and retry."); echo "<p>Rental Prices get UPDATED sucessfully,...</p>";
mysql_close($linkid);
|
|
| Top |
|
 |
|
lostboy
|
Post subject: Posted: Mon Apr 14, 2008 9:21 pm |
|
Joined: Sun May 02, 2004 11:34 pm Posts: 6535 Location: toronto, canada
|
|
Have you really stacked those queries into 1 big query separated by semi-colon? MySQL doesn't like that, it needs to run the queries individually
_________________ Lostboy
Cat, the other other white meat
Please read Posting Etiquette before posting
You can always try Google
|
|
| Top |
|
 |
|
lostboy
|
Post subject: Re: but I can login typing any word , well ? Posted: Mon Apr 14, 2008 9:33 pm |
|
Joined: Sun May 02, 2004 11:34 pm Posts: 6535 Location: toronto, canada
|
I think your if statement is formatted wrong
Leonidasphp wrote: After login.php I go to http://www.paphoscarhire.com/update-prices.php with: Code: <?php session_start(); // echo "<?xml version="1.0" encoding="iso-8859-1"?".">"; if ((($_POST['username'] == "pphch123s") && ($_POST['password'] == "retAsw123")) || ($_SESSION['login'] = "yes") || (($_POST['username'] == "guest") && ($_POST['password'] == "guest"))) { $_SESSION['login'] = "yes"; } else { // sleep(5); header('Location:login.php'); // echo "<p>Wrong Username or Password, you will redirected in a few seconds...</p>"; } ?> but I can login typing any word , well ? try this Code: <?php session_start(); // echo "<?xml version="1.0" encoding="iso-8859-1"?".">"; if (((($_POST['username'] == "pphch123s") && ($_POST['password'] == "retAsw123"))) || ($_SESSION['login']== "yes") || (($_POST['username'] == "guest") && ($_POST['password'] == "guest"))) { $_SESSION['login'] = "yes"; } else { // sleep(5); header('Location:login.php'); // echo "<p>Wrong Username or Password, you will redirected in a few seconds...</p>";
} ?>
_________________ Lostboy
Cat, the other other white meat
Please read Posting Etiquette before posting
You can always try Google
|
|
| Top |
|
 |
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum
|
|