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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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