Advertisement
contatowellington

Untitled

Jun 21st, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <?php
  2. if (!function_exists("GetSQLValueString")) {
  3. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  4. {
  5. if (PHP_VERSION < 6) {
  6. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  7. }
  8.  
  9. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  10.  
  11. switch ($theType) {
  12. case "text":
  13. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  14. break;
  15. case "long":
  16. case "int":
  17. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  18. break;
  19. case "double":
  20. $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  21. break;
  22. case "date":
  23. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  24. break;
  25. case "defined":
  26. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  27. break;
  28. }
  29. return $theValue;
  30. }
  31. }
  32.  
  33. $buscar_Recordset1 = "-1";
  34. if (isset($_GET['buscar'])) {
  35. $buscar_Recordset1 = $_GET['buscar'];
  36. }
  37. mysql_select_db($database_topagua, $topagua);
  38. $query_Recordset1 = sprintf("SELECT * FROM cadastro_cliente WHERE telefone = %s", GetSQLValueString($buscar_Recordset1, "text"));
  39. $Recordset1 = mysql_query($query_Recordset1, $topagua) or die(mysql_error());
  40. $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  41. $totalRows_Recordset1 = mysql_num_rows($Recordset1);
  42. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement