Professional Web Applications Themes

[PHP] newbY prob - PHP Development

> ! am trying to count the number of items in this table. The table > has one field in it. > > The code I am using is: > > $dbquerymeal = "select COUNT(*) from mealtype"; > $resultmeal = mysql_db_query($dbname,$dbqueryshipping1); > if(mysql_error()!=""){echo mysql_error();} > $mealcount = mysql_fetch_row($resultmeal); > echo $mealcount; > > The result I am getting is: > > Query was empty > Warning: mysql_fetch_row(): supplied argument is not a valid > MySQL result resource in search.php > > Any suggestions? Where is $dbqueryshipping1 set? I see $bdquerymeal, but not $dbqueryshipping1....

  1. #1

    Default RE: [PHP] newbY prob

    > ! am trying to count the number of items in this table. The table
    > has one field in it.
    >
    > The code I am using is:
    >
    > $dbquerymeal = "select COUNT(*) from mealtype";
    > $resultmeal = mysql_db_query($dbname,$dbqueryshipping1);
    > if(mysql_error()!=""){echo mysql_error();}
    > $mealcount = mysql_fetch_row($resultmeal);
    > echo $mealcount;
    >
    > The result I am getting is:
    >
    > Query was empty
    > Warning: mysql_fetch_row(): supplied argument is not a valid
    > MySQL result resource in search.php
    >
    > Any suggestions?
    Where is $dbqueryshipping1 set? I see $bdquerymeal, but not
    $dbqueryshipping1.

    Jennifer Goodie Guest

  2. #2

    Default Re: [PHP] newbY prob

    On 23 Jul 2003 at 15:38, Phillip Blancher wrote:
    > Problem with Count.
    >
    > ! am trying to count the number of items in this table. The table has
    > ! one field in it.
    >
    > The code I am using is:
    >
    > $dbquerymeal = "select COUNT(*) from mealtype";
    > $resultmeal = mysql_db_query($dbname,$dbqueryshipping1);
    shouldn't the second argument be $dbquerymeal ?

    R'twick

    R'Twick Niceorgaw Guest

  3. #3

    Default Re: [PHP] newbY prob

    From: "Jennifer Goodie" <goodieapollointeractive.com>
    > > ! am trying to count the number of items in this table. The table
    > > has one field in it.
    > >
    > > The code I am using is:
    > >
    > > $dbquerymeal = "select COUNT(*) from mealtype";
    > > $resultmeal = mysql_db_query($dbname,$dbqueryshipping1);
    > > if(mysql_error()!=""){echo mysql_error();}
    > > $mealcount = mysql_fetch_row($resultmeal);
    > > echo $mealcount;
    > >
    > > The result I am getting is:
    > >
    > > Query was empty
    > > Warning: mysql_fetch_row(): supplied argument is not a valid
    > > MySQL result resource in search.php
    > >
    > > Any suggestions?
    >
    > Where is $dbqueryshipping1 set? I see $bdquerymeal, but not
    > $dbqueryshipping1.
    Also, once you fix that, $mealcount is going to be an array. You need to
    display $mealcount[0] to get the value.

    ---John Holmes...

    Cpt John W. Holmes Guest

Similar Threads

  1. Newby help!
    By Max Arwood in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 1
    Last Post: November 15th, 02:02 AM
  2. A very newby question
    By _LJ in forum Macromedia Flex General Discussion
    Replies: 3
    Last Post: May 16th, 07:44 PM
  3. Newby Question: hither and yon?
    By lduncalfe in forum Macromedia Director 3D
    Replies: 2
    Last Post: August 9th, 10:42 AM
  4. Real newby help - please!
    By Ted Rogers in forum PHP Development
    Replies: 1
    Last Post: October 3rd, 10:27 AM
  5. newbY prob
    By Kevin Stone in forum PHP Development
    Replies: 0
    Last Post: July 23rd, 07:48 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