doubt regarding mysql & php

From: Date: Sat, 28 Jul 2001 08:41:21 +0000
Subject: doubt regarding mysql & php
Groups: php.general 
Request: Send a blank email to php-general+get-60033@lists.php.net to get a copy of this message
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

The Information contained and transmitted by this E-MAIL is proprietary to Wipro Limited and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If this is a forwarded message, the content of this E-MAIL may not have been sent with the authority of the Company. If you are not the intended recipient, an agent of the intended recipient or a person responsible for delivering the information to the named recipient, you are notified that any use, distribution, transmission, printing, copying or dissemination of this information in any way or in any manner is strictly prohibited. If you have received this communication in error, please delete this mail & notify us immediately at mailadmin@wipro.com.
« previous php.general (#60033) next »