Foros del Web » Programando para Internet » PHP »

Instalacion de php script

Estas en el tema de Instalacion de php script en el foro de PHP en Foros del Web. Hola Compre un script y he seguido las instrucciones pero no entiendo como configurar el archivo que conecta el script con Mysql. Si alguien me ...
  #1 (permalink)  
Antiguo 10/01/2012, 22:27
 
Fecha de Ingreso: octubre-2011
Mensajes: 12
Antigüedad: 12 años, 6 meses
Puntos: 0
Instalacion de php script

Hola

Compre un script y he seguido las instrucciones pero no entiendo como configurar el archivo que conecta el script con Mysql.

Si alguien me puede ayudar.

Gracias.
  #2 (permalink)  
Antiguo 10/01/2012, 22:36
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Instalacion de php script

¿En las instrucciones no dice nada al respecto de configuración?

Sería interesante que nos compartieras dicho código, así podríamos indicarte algo positivo.
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #3 (permalink)  
Antiguo 10/01/2012, 23:14
 
Fecha de Ingreso: octubre-2011
Mensajes: 12
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: Instalacion de php script

Gracias por responder.

No dice algo respecto a la configuración pero no lo entiendo bien ya que llene los datos pero esto errores son los que me salen www.bids507.com

Aqui esta el codigo
Código PHP:
Ver original
  1. <?php
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9. class DB
  10.  
  11.  
  12.  
  13. {
  14.  
  15.  
  16.  
  17. // Connection parameters
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. var $host = 'localhost';
  26.  
  27.  
  28.  
  29. var $user ="user";
  30.  
  31.  
  32.  
  33. var $password ="password";
  34.  
  35.  
  36.  
  37. var $database ='database';
  38.  
  39.  
  40.  
  41. var $persistent = false;
  42.  
  43.  
  44.  
  45. var $adminid='admin';
  46.  
  47.  
  48.  
  49. var $adminipwd='admin';
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. // Database connection handle
  70.  
  71.  
  72.  
  73. var $conn = NULL;
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81. // Query result
  82.  
  83.  
  84.  
  85. var $result = false;
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93. // function DB($host, $user, $password, $database, $persistent = false)
  94.  
  95.  
  96.  
  97. function DB()
  98.  
  99.  
  100.  
  101. {
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109. }
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117. function open()
  118.  
  119.  
  120.  
  121. {
  122.  
  123.  
  124.  
  125. // Choose the appropriate connect function
  126.  
  127.  
  128.  
  129. if ($this->persistent) {
  130.  
  131.  
  132.  
  133. $func = 'mysql_pconnect';
  134.  
  135.  
  136.  
  137. } else {
  138.  
  139.  
  140.  
  141. $func = 'mysql_connect';
  142.  
  143.  
  144.  
  145. }
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153. // Connect to the MySQL server
  154.  
  155.  
  156.  
  157. $this->conn = $func($this->host, $this->user, $this->password);
  158.  
  159.  
  160.  
  161. if (!$this->conn) {
  162.  
  163.  
  164.  
  165. return false;
  166.  
  167.  
  168.  
  169. }
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177. // Select the requested database
  178.  
  179.  
  180.  
  181. if (!@mysql_select_db($this->database, $this->conn)) {
  182.  
  183.  
  184.  
  185. return false;
  186.  
  187.  
  188.  
  189. }
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197. return true;
  198.  
  199.  
  200.  
  201. }
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213. function close()
  214.  
  215.  
  216.  
  217. {
  218.  
  219.  
  220.  
  221. return (@mysql_close($this->conn));
  222.  
  223.  
  224.  
  225. }
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233. function error()
  234.  
  235.  
  236.  
  237. {
  238.  
  239.  
  240.  
  241. return (mysql_error());
  242.  
  243.  
  244.  
  245. }
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253. function query($sql = '')
  254.  
  255.  
  256.  
  257. {
  258.  
  259.  
  260.  
  261. $this->result = @mysql_query($sql, $this->conn);
  262.  
  263.  
  264.  
  265. return ($this->result != false);
  266.  
  267.  
  268.  
  269. }
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277. function affectedRows()
  278.  
  279.  
  280.  
  281. {
  282.  
  283.  
  284.  
  285. return (@mysql_affected_rows($this->conn));
  286.  
  287.  
  288.  
  289. }
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297. function numRows()
  298.  
  299.  
  300.  
  301. {
  302.  
  303.  
  304.  
  305. return (@mysql_num_rows($this->result));
  306.  
  307.  
  308.  
  309. }
  310.  
  311.  
  312.  
  313. function fieldName($field)
  314.  
  315.  
  316.  
  317. {
  318.  
  319.  
  320.  
  321. return (@mysql_field_name($this->result,$field));
  322.  
  323.  
  324.  
  325. }
  326.  
  327.  
  328.  
  329. function insertID()
  330.  
  331.  
  332.  
  333. {
  334.  
  335.  
  336.  
  337. return (@mysql_insert_id($this->conn));
  338.  
  339.  
  340.  
  341. }
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349. function fetchObject()
  350.  
  351.  
  352.  
  353. {
  354.  
  355.  
  356.  
  357. return (@mysql_fetch_object($this->result, MYSQL_ASSOC));
  358.  
  359.  
  360.  
  361. }
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369. function fetchArray()
  370.  
  371.  
  372.  
  373. {
  374.  
  375.  
  376.  
  377. return (@mysql_fetch_array($this->result, MYSQL_NUM));
  378.  
  379.  
  380.  
  381. }
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389. function fetchAssoc()
  390.  
  391.  
  392.  
  393. {
  394.  
  395.  
  396.  
  397. return (@mysql_fetch_assoc($this->result));
  398.  
  399.  
  400.  
  401. }
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409. function freeResult()
  410.  
  411.  
  412.  
  413. {
  414.  
  415.  
  416.  
  417. return (@mysql_free_result($this->result));
  418.  
  419.  
  420.  
  421. }
  422.  
  423.  
  424.  
  425. }
  426.  
  427.  
  428.  
  429. define('_BASEURL_','http://yourdomain.com/');
  430.  
  431.  
  432.  
  433. /*
  434.  
  435.  
  436.  
  437. define('_BASEURLCSSNEW_','http://yourdomain.com');
  438.  
  439.  
  440.  
  441. define('_BASEURLICONS_','http://yourdomain.com');
  442.  
  443.  
  444.  
  445. define('_BASEURLHOWITWORKS_','http://yourdomain.com');
  446.  
  447.  
  448.  
  449. define('_BASEURLTEMPLATEIMAGE_','http://yourdomain.com');
  450.  
  451.  
  452.  
  453. define('_BASEURLMEDIA_','http://yourdomain.com');
  454.  
  455.  
  456.  
  457. define('_BASEURLMEDIAIMAGES_','http://yourdomain.com');
  458.  
  459.  
  460.  
  461. */
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469. define('_BASEURLCSSNEW_','http://yourdomain.com/div2');
  470.  
  471.  
  472.  
  473. define('_BASEURLICONS_','http://yourdomain.com/div2');
  474.  
  475.  
  476.  
  477. define('_BASEURLHOWITWORKS_','http://yourdomain.com/div2');
  478.  
  479.  
  480.  
  481. define('_BASEURLTEMPLATEIMAGE_','http://yourdomain.com/div2');
  482.  
  483.  
  484.  
  485. define('_BASEURLMEDIA_','http://yourdomain.com/div2');
  486.  
  487.  
  488.  
  489. define('_BASEURLMEDIAIMAGES_','http://yourdomain.com/div2');
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497. define('_BASEPATH_','/home/domain/public_html/');
  498.  
  499.  
  500.  
  501. define('_IMAGESURL_',_BASEURL_.'/images');
  502.  
  503.  
  504.  
  505. define('_IMAGESPATH_',_BASEPATH_.'/images');
  506.  
  507.  
  508.  
  509. define('_IMAGESURLM_',_BASEURL_.'notesimages');
  510.  
  511.  
  512.  
  513. define('_IMAGESPATHM_',_BASEPATH_.'notesimages');
  514.  
  515.  
  516.  
  517. define('_ADMIN_MAIL_','[email protected]');
  518.  
  519.  
  520.  
  521. define('_TITLE_','yourdomain.com | ');
  522.  
  523.  
  524.  
  525. define('_TITLE1_','yourdomain.com');
  526.  
  527.  
  528.  
  529. $accepted_upload_extensions_pics = array('gif','jpg','jpeg','png');
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537. function get_uname($uid){
  538.  
  539.  
  540.  
  541. $sql="select * from user where id='$uid'";
  542.  
  543.  
  544.  
  545. $myrwd=mysql_query($sql);
  546.  
  547.  
  548.  
  549. $myuname=mysql_fetch_array($myrwd);
  550.  
  551.  
  552.  
  553. $uname=$myuname['uname'];
  554.  
  555.  
  556.  
  557. return $uname;
  558.  
  559.  
  560.  
  561. }
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573. ?>
  #4 (permalink)  
Antiguo 10/01/2012, 23:18
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Instalacion de php script

Pues definitivamente debes editar estos valores:
Código PHP:
var $host 'localhost';
var 
$user ="user";
var 
$password ="password";
var 
$database ='database'
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #5 (permalink)  
Antiguo 10/01/2012, 23:27
 
Fecha de Ingreso: octubre-2011
Mensajes: 12
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: Instalacion de php script

Ya los he editado.
  #6 (permalink)  
Antiguo 10/01/2012, 23:28
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Instalacion de php script

¿Y que sucede?
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #7 (permalink)  
Antiguo 10/01/2012, 23:30
 
Fecha de Ingreso: octubre-2011
Mensajes: 12
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: Instalacion de php script

en var $host = 'localhost'; va el host name de mysql correcto?

Gracias
  #8 (permalink)  
Antiguo 10/01/2012, 23:31
 
Fecha de Ingreso: octubre-2011
Mensajes: 12
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: Instalacion de php script

me segui dando los mismos errores.
  #9 (permalink)  
Antiguo 10/01/2012, 23:34
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Instalacion de php script

Muestra los valores que estás colocando, así al tanteo es complicado decirte si algo introduces mal.
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #10 (permalink)  
Antiguo 10/01/2012, 23:36
 
Fecha de Ingreso: octubre-2011
Mensajes: 12
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: Instalacion de php script

var $host = 'bids507hcl.db.8815630.hostedresource.com';

var $user ="bids507hcl";

var $password ="pass";

var $database ='bids507hcl';

var $persistent = false;

var $adminid='bids507hcl';

var $adminipwd= 'Mi pass no lo pondre por seguridad';
  #11 (permalink)  
Antiguo 11/01/2012, 00:03
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: Instalacion de php script

¿Y aún así te sigue dando el mismo error? ¿Lo estás ejecutando en local o remoto?
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #12 (permalink)  
Antiguo 11/01/2012, 01:59
 
Fecha de Ingreso: octubre-2011
Mensajes: 12
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: Instalacion de php script

Esta en remoto

Etiquetas: mysql
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:33.