Jump to content

Php mysql help me '


maxbox

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.