Last active
December 18, 2015 01:09
-
-
Save ricardosiri68/5701613 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$numerotel = $_POST['telefono']; | |
$conectar = mysql_connect("localhost","root","" ); | |
mysql_select_db("usuario",$conectar); | |
//Me parece que el error debe andar aquí | |
$seleccionar = "SELECT numero FROM telefonico"; | |
$result = mysql_query($seleccionar,$conectar); | |
$rowCount = mysql_row_count($result); | |
if ($rowCount <= 0) { | |
$codigo = "INSERT INTO numero | |
(telefonico) | |
VALUES ('$numerotel')"; | |
} | |
else { | |
$row = mysql_fetch_row($result); | |
$numerotel = $row['numero']; | |
$codigo = "UPDATE numero SET telefonico = '$numerotel'"; | |
} | |
mysql_query($codigo,$conectar); | |
mysql_close($conectar); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment