Ver Mensaje Individual
  #6 (permalink)  
Antiguo 25/08/2010, 10:11
Avatar de oscarios
oscarios
 
Fecha de Ingreso: septiembre-2004
Mensajes: 186
Antigüedad: 19 años, 7 meses
Puntos: 2
Respuesta: consulta de access a dreamweaver con mysql

TE PONGO TODO EL CODIGO, DEPRONTO LO QUIERES VER

BUENO NO ME DEJO PONERLO TODO TE PONGO ESTA PARTE ENTONCES

Código PHP:
Ver original
  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. $colname_Recordset1 = "-1";
  34. if (isset($_GET['codigo_inm'])) {
  35.   $colname_Recordset1 = $_GET['codigo_inm'];
  36. }
  37. mysql_select_db($database_conbanca, $conbanca);
  38. $query_Recordset1 = sprintf("SELECT * FROM inmuebles WHERE codigo_inm = %s", GetSQLValueString($colname_Recordset1, "text"));
  39. $Recordset1 = mysql_query($query_Recordset1, $conbanca) or die(mysql_error());
  40. $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  41. $totalRows_Recordset1 = mysql_num_rows($Recordset1);
  42.  
  43. mysql_select_db($database_conbanca, $conbanca);
  44. $query_Recordset2 = "SELECT inmuebles.codigo_inm, inmuebles.valor, (inmuebles.valor*30/100) AS inicial, (inmuebles.valor-inmuebles.valor*30/100)*(16500/1000000) AS canon FROM inmuebles";
  45. $Recordset2 = mysql_query($query_Recordset2, $conbanca) or die(mysql_error());
  46. $row_Recordset2 = mysql_fetch_assoc($Recordset2);
  47. $totalRows_Recordset2 = mysql_num_rows($Recordset2);
  48. ?>
  49. //<?php