cdiego

video_11_puntosDAO.php

Aug 28th, 2013
1,412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?php
  2. include_once 'conex.php';//INCLUIR CONEXION DE BASE DE DATOS
  3.  
  4. class puntosDao
  5. {
  6.     private $r;
  7.     public function __construct()
  8.     {
  9.         $this->r = array();
  10.     }
  11.     public function grabar($titulo, $cx,$cy)//METODO PARA GRABAR A LA BD
  12.     {
  13.         $con = conex::con();
  14.         $titulo = mysql_real_escape_string($titulo);
  15.         $cx = mysql_real_escape_string($cx);
  16.         $cy = mysql_real_escape_string($cy);
  17.         $q = "insert into puntos (Titulo, cx, cy)".
  18.              "values ('".addslashes($titulo)."','".addslashes($cx)."','".addslashes($cy)."')";
  19.         $rpta = mysql_query($q, $con);
  20.         mysql_close($con);
  21.         if($rpta==1)
  22.         {
  23.             return TRUE;
  24.         }
  25.         else
  26.         {
  27.             return FALSE;
  28.         }
  29.     }
  30.  }
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment