maxbox Posted January 2, 2009 Share Posted January 2, 2009 Hello Can you help me , i need delete and send the values 'code ' after validated to another tables . delete from jos_call and move them to jos_call1 <?php $mysql_host="xxxxxxxxxxx"; $mysql_user="xxxxxxxxxx"; $mysql_password="xxxxxxxxxx"; $mysql_db = "xxxxxxxxx"; $conn = mysql_connect("$mysql_host","$mysql_user","$mysql_password")or die("Could not connect : " . mysql_error()); mysql_select_db("$mysql_db",$conn) or die("Select database failed"); $var=@$_REQUEST['nombre']."'"; $query= mysql_query("Select * from jos_call where code = '".$var,@$conn); if (mysql_num_rows($query) == 0 ) { echo @$_REQUEST['nombre'].' Su codigo 6 digitos.Codigo no valido.'; }else{ echo @$_REQUEST['nombre'].' Codigo correcto! ' ; } something here.... mysql_close($conn); ?> Link to comment https://forums.phpfreaks.com/topic/139202-php-mysql-help-me/ Share on other sites More sharing options...
dennismonsewicz Posted January 2, 2009 Share Posted January 2, 2009 i would google mysql insert select or something like that. Cause you are going to need to insert results from table1 into table2 then delete table1. Link to comment https://forums.phpfreaks.com/topic/139202-php-mysql-help-me/#findComment-728077 Share on other sites More sharing options...
maxbox Posted January 2, 2009 Author Share Posted January 2, 2009 exactly, but i cant doing this self but i have tryed with this and received 500 internal server error. <?php $mysql_host="xxxxxxxxxxx"; $mysql_user="xxxxxxxxxx"; $mysql_password="xxxxxxxxxx"; $mysql_db = "xxxxxxxxx"; $conn = mysql_connect("$mysql_host","$mysql_user","$mysql_password")or die("Could not connect : " . mysql_error()); mysql_select_db("$mysql_db",$conn) or die("Select database failed"); $var=@$_REQUEST['nombre']."'"; $query= mysql_query("Select * from jos_call where code = '".$var,@$conn); if (mysql_num_rows($query) == 0 ) { echo @$_REQUEST['nombre'].' Su codigo 6 digitos.Codigo no valido.'; }else{ echo @$_REQUEST['nombre'].' Codigo correcto! ' ; } else{ $query= mysql_query("INSERT INTO jos_call1 where code = '".$query,@$conn); $query= mysql_query("delete from jos_call where code = '".$query,@$conn); } } mysql_close($conn); ?> Link to comment https://forums.phpfreaks.com/topic/139202-php-mysql-help-me/#findComment-728086 Share on other sites More sharing options...
dennismonsewicz Posted January 2, 2009 Share Posted January 2, 2009 are you building a component in Joomla? The jos table prefix is a joomla thing... just wondering Link to comment https://forums.phpfreaks.com/topic/139202-php-mysql-help-me/#findComment-728089 Share on other sites More sharing options...
maxbox Posted January 2, 2009 Author Share Posted January 2, 2009 This is not a component i need this in order to receive payments and the code must be valid only one time.the user cannot use the code more than one time. Jos prefix is from my host for security. ... Link to comment https://forums.phpfreaks.com/topic/139202-php-mysql-help-me/#findComment-728096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.