Created
May 24, 2015 11:00
-
-
Save d30jeff/89b4b006f6a6c8c39f8d to your computer and use it in GitHub Desktop.
b
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 | |
| function validation(){ | |
| $dbServer = 'localhost'; | |
| $dbUserName = 'root'; | |
| $dbPassword = ''; | |
| $dbName = 'DBeoi'; | |
| if (isset($_POST['eoinumber'],$_POST['lastcheck'])){ | |
| $eoinumber = $_POST['eoinumber']; | |
| $lastname = $_POST['lastcheck']; | |
| $dbConx = new mysqli($dbServer, $dbUserName, $dbPassword, $dbName); | |
| $eoinumber = $dbConx->real_escape_string($eoinumber); | |
| $lastname = $dbConx->real_escape_string($lastname); | |
| if (!$dbConx){ | |
| echo '<p>Unable to connection to database. </p>'; | |
| } else { | |
| $sql = "SELECT id FROM eoi WHERE id='$eoinumber'"; | |
| $query = $dbConx->query($sql); | |
| if ($query->num_rows){ | |
| echo 'exists'; | |
| } else { | |
| echo 'ok'; | |
| } | |
| } | |
| } | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment