Jump to content

jeva39

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jeva39's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I try to load records into a Table but repeat in the two colums the same field and only the first record. No rows for the rest of records... For example, the first record is "A la candela" and the rhythm is "Merengue". The output is "A la candela" "A la candela" And repeat this record forever You can check this at: http://www.prolatin.com/php/jv_mysql2.php This is the code: [code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Pruebas</title> <link rel="stylesheet" type="text/css" href="lib.css"> </head> <body bgcolor="#FFFFFF" text="#996600" link="#996600" vlink="#996600" alink="#996600"> <table width="90%" border="1" align=center bgcolor="#FFFFFF"> <tr> <td> <?php ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); $con = mysql_connect("localhost", "username", "pass")or die('MySQL Connect Error: '.mysql_error()); mysql_select_db("jv"); $sql = "select tema,ritmo from temas order by tema"; $queryexe = mysql_query($sql); while(mysql_fetch_row($queryexe))     {   $tema = mysql_result($queryexe, "tema");    $ritmo = mysql_result($queryexe, "ritmo");   ?>   <tr>   <td class="listas" bgcolor="#f7efde"> <?php print ("$tema"); ?></td>   <td class="listas" bgcolor="#f7efde"> <?php print ("$ritmo"); ?></td>   </tr> <?php }   echo "Error: " . mysql_error(); ?> </td> </tr> </table>                                        </body> </html> [/code] Thanks for your help!!!
  2. Hello I use this simple code to try something in my Web Server (Using PHP 4.4 and mySql 4.1): [code]<?php $con = mysql_connect("localhost", "username", "pass"); mysql_select_db("jv"); $query  = "SELECT tema, ritmo FROM temas where ritmo='BALADA' order by tema"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_NUM)) // Line 8 {     echo "Tema : {$row[0]} " . " Ritmo : {$row[1]} <br>"; } mysql_close($con); ?>[/code] But I receive this error: [color=red]Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\Inetpub\vhosts\prolatin.com\httpdocs\php\jv_mysql.php on line 8 [/color] The Database don't have problem. Please do you can help me what is wrong? In my computer all run OK. Thanks in advanced....
  3. jeva39

    Load Data

    How I can to load data from a table in my computer into a table in my Web Server database? They don't have implemented phpMyAdmin or mySql Administrator. Thanks
  4. Thanks but unfortunately don't work. If, with the same code (changing the "Connect" tag to ODBC format), I change the [b]mySql functions [/b] by [b]odbc functions [/b] work. Otherwise, no. I do not know what happens. In my Web Server neither work but by another reason: I don't know how or what privileges I need to manage mySql and although I send the ticket to consult the problem, not yet have responded to me. 
  5. Thanks wildteen88 for your help. I use NuSphere Editor for see the [b]phpinfo.php [/b] without need to upload the file and I found this. (I understand according to your post that [b]mysql [/b] functions are enabled, right?)                        mysql MySQL Support                  enabled Active Persistent Links              0  Active Links                            0  Client API version                 3.23.49  Directive                          Local Value              Master Value mysql.allow_persistent            On                           On mysql.connect_timeout           60                           60 mysql.default_host              no value                   no value mysql.default_password       no value                   no value mysql.default_port              no value                   no value mysql.default_socket           no value                  no value mysql.default_user              no value                  no value mysql.max_links                  Unlimited                 Unlimited mysql.max_persistent          Unlimited                 Unlimited mysql.trace_mode              Off                           Off The code I use for try an example is this: (Really I'm absolutely new to PHP. Allways I work with ASP/ASP.NET) [code]......more code..... <?php $con = mysql_connect("localhost", "root", "doremi"); mysql_select_db("jv"); $sql = "select id,tema,ritmo, archivo,fecha from temas order by tema"; $queryexe = mysql_query($sql);   print($queryexe); while(mysql_fetch_row($queryexe))     {   $id = mysql_result($queryexe, 1); //Puede ser $id= odbc_result($queryexe, "id");   $tema = mysql_result($queryexe, 2);    $ritmo = mysql_result($queryexe, 3);   $archivo = mysql_result($queryexe, 4);   $fecha = mysql_result($queryexe, 5); ?>     <tr>     <td class="listas" bgcolor="#f7efde"> <?php print ("$tema"); ?></td>     <td class="listas" bgcolor="#f7efde"> <?php print ("$ritmo"); ?></td>     <td class="listas" bgcolor="#f7efde"> <?php print ("$archivo"); ?></td>     <td class="listas" bgcolor="#f7efde"> <?php print ("$fecha"); ?></td>     </tr> <?php }?> ........more code.......[/code] This code don't send any error but don't process nothing! Thanks again for your time....
  6. The real problem is that all mysql functions don't work in PHP  and phpMyAdmin neither work (and the configuration is OK!).
  7. I understand that In order to have MySql 5.0 functions available in PHP, I must compile PHP with support for the mysqli extension. Please, how I can do this? I use PHP 4.3 Thanks!
  8. I have problem with phpMyAdmin. I install phpMyAdmin and configure with this config.inc.php file: [code]<?php $i=0; $i++; $cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['auth_type'] = 'http'; $cfg['Servers'][$i]['user']          = 'root'; $cfg['Servers'][$i]['password']      = 'mypassword'; ?> [/code] When I try to use, appears the [b]Connect to localhost [/b] window but don't accept User/Password and never permit access the app. What is wrong? Finally, In fact I have created the [b]database.sql[/b]. I did with the command line of mySql. It is the this file that I must to upload?. If phpMyAdmin does not work for me, how I can to send the file to my server? Thanks for your time...
  9. Is the first time I work with mySql and I create a DB for testing. I need to upload this DB from my computer to the server (1hostPlan) but I don't know where is located the Database file or what is the file that I need to upload. I install mySql in C:\mySql Thanks!!
  10. I install phpMyAdmin and configure with this config.inc.php file: [code]<?php $i=0; $i++; $cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['auth_type'] = 'http'; $cfg['Servers'][$i]['user']          = 'root'; $cfg['Servers'][$i]['password']      = 'mypassword'; ?> [/code] Appears the [b]Connect to localhost [/b] window but don't accept User/Password and never permit access the app. Please, what is wrong? Thanks
  11. Thanks. All run OK!!!
  12. I install mySql in XP Professional machine and I define Password but not USER. I undertand that I can use root like user but when I try, for example, to run [b]mySql> mysql -u root [/b] (or other command), I receive this error. [b]Access denied for user 'root'@' localhost <using password:NO>[/b] It has not been possible to obtain that mySql runs. I install acording with rules in PHP manual but...nothing!! Can you help me? Thanks in advanced because is urgent for me
  13. Thanks very much ToonMariner! All working fine  :) My problem is that I work many time with ASP and ASP.NET and I still confused with the PHP syntax. Really, thanks.. Jorge, Panamá
  14. Please what is the correct syntax for include a variable in a sql query like this: $tipo=_GET['clas'] $sql = 'select id,clase,tema,ritmo,autor,arreglo,fecha,kar,nuevo,archivo from temas where CLASE like [b]I NEED INCLUDE $tipo HERE [/b] order by ' . $sort; Thanks in advanced....
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.