Professional Web Applications Themes

Problem with MySQL (??) - MySQL

Hi. I started local apache ( v.2.0) server on my desktop computer. I've installed php (v.5) and MySQL (v.5) I wrote php script that connects to MySQL server and everything was O.K. But then I tried to do the same thing on my laptop so (Apache 2.2 php 5 and MySQL 5) I've impotrted database to my laptop and everything seemed to be ok. When I started php script it didin't return any database record. Could anyone give me some ideas why it doesn't work? Here is the function that conects and gets data from database function pobierz_wszystko2($tabela,$kolumna) { require_once('./polaczenie.php'); ...

  1. #1

    Default Problem with MySQL (??)

    Hi.
    I started local apache ( v.2.0) server on my desktop computer.
    I've installed php (v.5) and MySQL (v.5) I wrote php script that connects to
    MySQL server and everything was O.K. But then I tried to do the same thing
    on my laptop so (Apache 2.2 php 5 and MySQL 5) I've impotrted database to my
    laptop and everything seemed to be ok. When I started php script it didin't
    return any database record.

    Could anyone give me some ideas why it doesn't work?
    Here is the function that conects and gets data from database

    function pobierz_wszystko2($tabela,$kolumna)
    {
    require_once('./polaczenie.php'); //connection


    $zapytanie="SELECT DISTINCT $kolumna //query
    FROM $tabela AS h, dostepne AS d
    WHERE h.pokoj_id= d.pokoj_id
    AND d.ile_pokoi >0;
    ";
    $wynik=mysql_query($zapytanie);
    while($wiersz=mysql_fetch_array($wynik,MYSQL_BOTH) )
    {
    $wartosc=return_data($wiersz[$kolumna]);
    echo "<option value='$wartosc'>$wartosc</option> <br />";
    }
    }



    It seems that while loop is proceeded correct number of times but all I'm
    getting are empty lines...

    Could it be caused by wrong settings in MySQL configuration file?


    Leszek Guest

  2. #2

    Default Re: Problem with MySQL (??)

    Leszek wrote:
    > $zapytanie="SELECT DISTINCT $kolumna //query
    > FROM $tabela AS h, dostepne AS d
    > WHERE h.pokoj_id= d.pokoj_id
    > AND d.ile_pokoi >0;
    > ";
    > $wynik=mysql_query($zapytanie);

    You aren't checking for errors from mysql_query(). You also don't know
    what the string $zapytanie looks like before you use it as a query.
    Perhaps the variables don't create the query as you expect them to.

    Regards,
    Bill K.
    Bill Karwin Guest

Similar Threads

  1. Need Help, problem with OSX, MySQL, etc.
    By Jerry McEwen in forum MySQL
    Replies: 4
    Last Post: May 11th, 11:32 PM
  2. Replies: 0
    Last Post: January 29th, 02:03 PM
  3. Replies: 2
    Last Post: July 2nd, 09:21 PM
  4. CGI DBI MySql problem
    By Cognition Peon in forum PERL Modules
    Replies: 1
    Last Post: November 18th, 12:32 AM
  5. Replies: 3
    Last Post: October 28th, 05:28 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139