Re: doubt regarding mysql & php

From: Date: Mon, 30 Jul 2001 08:52:35 +0000
Subject: Re: doubt regarding mysql & php
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60163@lists.php.net to get a copy of this message
a = b means PASSWORD(a) = PASSWORD(b) therefore, if correct password is 'a' and it was stored in the database like PASSWORD(a) then the user's inputed password is 'b' and must be equal like: PASSWORD(a) = PASSWORD(b) ============= "Balaji Ankem" <balaji.ankem@wipro.com> wrote in message news:002801c11741$14997940$1702910a@wipro.com... Hi dearest friend, can we update the same row immediately after selection. please see the following code at line number 29 it is giving error. code ------------------------------------ <?php // Connect to MySQL $connection = mysql_connect( 'localhost', 'balaji', 'pingpong' ) or die ( 'Unable to connect to server.' ); // Select database on MySQL server mysql_select_db( 'imac' ) or die ( 'Unable to select database.' ); // Formulate the query (inv_tag will come by post method $sql1 = "SELECT * FROM inventory WHERE inv_tag = '$inv_tag'"; // Execute the query and put results in $result $result1 = mysql_query( $sql1 ) or die ( 'Unable to select the data from inventory.' ); if ( $result1 ) { //change the status of the inventory item in inventory table $sql2="UPDATE inventory SET inv_status="assigned" where inv_tag='$inv_tag' "; // This is line number 29. $result2 = mysql_query( $sql2 ) or die ( 'Unable to execute query for upadation of inventory table.' ); $sql3 = "insert into status values('$inv_name','$inv_type','$inv_tag','$issued_to','$issued_by','$issue_ date')"; $result3 = mysql_query( $sql3 ) or die ( 'Unable to execute query for insertion in to status table.' ); } else { // header( 'WWW-Authenticate: Basic realm="Private"' ); // header( 'HTTP/1.0 401 Unauthorized' ); echo '$inv_tag does not exist'; exit; } ?> please inform if any errors. Thanks in advance. Regards -Balaji

« previous php.general (#60163) next »