problem with db function php

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default problem with db function php

    hi

    echo '<table>';
    $requete = mysql_query("SELECT liv_nolivre, sec_nosection,
    liv_commentaire, liv_titre FROM livre");


    if ( mysql_num_rows($requete) != 0 )
    {
    while ($requete = mysql_fetch_assoc($requete)) {
    echo'<tr class="tabtitre"><td>'.$requete["liv_titre"].'</td></tr>',
    '<tr><td>'.$requete["liv_commentaire"].' </td></tr>';
    }
    }
    echo '</table>';

    i get:


    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL
    result resource

    any idea?

    maybe my echo is not good?
    --
    Borland rulez [url]http://pages.infinit.net/borland[/url]
    Marc Collin Guest

  2. Similar Questions and Discussions

    1. Problem with function ListGetAt
      I have written the code for a DB driven image viewer. It is pretty simple. I am having a problem with my navagtion going to the previous and next...
    2. Problem using GD function
      Hi all, I've got a Red Hat 9 system with gd-1.8.4 installed and php-4.3.4 working on apache 2.0.48. When I try to use the imagecreatefromjpeg...
    3. Function Problem
      Hi, I have the following function below used to make a couple of calculations however as soon as I have two records the function calculation is...
    4. Problem with split function
      Hi all, I am having a problem with the split function. Here is my code: $_ = "123 a 456 b 789 c"; my @words = split /+/, $_; print...
    5. [PHP] isset function problem
      What about the rest of the code? How is this variable defined? I have had this happen in some code before, I found that the variable was set to...
  3. #2

    Default Re: problem with db function php

    "Marc Collin" <os2@videotron.ca> wrote in message
    news:8eGjc.69832$Tu2.1587055@weber.videotron.net.. .
    > hi
    >
    > echo '<table>';
    > $requete = mysql_query("SELECT liv_nolivre, sec_nosection,
    > liv_commentaire, liv_titre FROM livre");
    >
    >
    > if ( mysql_num_rows($requete) != 0 )
    > {
    > while ($requete = mysql_fetch_assoc($requete)) {
    Here you replaced your result set with an array. $requete is being assigned.

    - Virgil


    Virgil Green Guest

Posting Permissions

  • You may not post new threads
  • You may 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