Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Unknown column '****' in 'field list'
Old 09-02-2010, 01:40 PM Unknown column '****' in 'field list'
Junior Talker

Posts: 2
Name: Craig
Trades: 0
I'm a student having troubles with PHP that i am trying to teach myself after a year without touching it...i've managed to overcome a few problems.. but i'm attempting a query but getting the aforementioned error for...

**Unknown column 'Dresscode' in 'field list' **

Here's the code...

PHP Code:
<?php
        
        
include 'trnconnect.php';
        
        
$ratingdata mysqli_query($link"SELECT * FROM venues order by (vRatingtotal DIV vRatingnumber) desc, vRatingnumber desc limit 10");
        while(
$ratinginfo mysqli_fetch_array($ratingdata)) {
            
$venueid           $ratinginfo['venueID'];             
            
$vRatingnumber    $ratinginfo['vRatingnumber'];           
            
$vRatingtotal     $ratinginfo['vRatingtotal'];      
            
$vName            $ratinginfo['vName'];     
            
$vAddress        $ratinginfo['vAddress'];      
            
$vPostcode        $ratinginfo['vPostcode'];     
            
$vPhone            $ratinginfo['vPhone'];
            
$vDesc            $ratinginfo['vDesc'];         
            
$vCapacity        $ratinginfo['vCapacity'];         
            
$vPriceID        $ratinginfo['vPriceID'];
            
$vRestrictionID    $ratinginfo['vRestrictionID'];         
            
$vDressID        $ratinginfo['vDressID'];         
            
$vGenreID        $ratinginfo['vGenreID'];             
            
$locationID        $ratinginfo['locationID'];             
            
$regionID        $ratinginfo['regionID']; 
            
            
$q="SELECT Dresscode, Category, Restriction, Genre, lName, rName".
                   
"FROM vdress, vprice, vrestriction, vgenre, locations, regions".
                   
"WHERE     (vdress.vDressID=$vDressID) AND
                          (vprice.vPriceID=
$vPriceID) AND  
                          (vrestriction.vRestrictionID=
$vRestrictionID) AND
                          (vgenre.vGenreID=
$vGenreID) AND
                          (locations.locationID=
$locationID) AND
                          (regions.regionID=
$regionID)";
                        
            
$venue_data mysqli_query($link$q) or die (mysqli_error($link));
            
$venue_info mysqli_fetch_array($venue_data);
            
$Dresscode        $venue_info['Dresscode']; 
            
$Category        $venue_info['Category']; 
            
$Restriction    $venue_info['Restriction']; 
            
$Genre            $venue_info['Genre']; 
            
$lName            $venue_info['lName']; 
            
$rName            $venue_info['rName']; 
            
            
            
                        
            echo 
"<h2>",$vName,"</h2>\n";
            
$output_address str_replace(","",<br/>""$vAddress");
            echo 
"<p>",$output_address,"</p>\n";
            echo 
"<p>",$vPostcode,"</p>\n";
            echo 
"<p>Tel: ",$vPhone,"</p>\n";
            
            echo 
"<p>",$vDesc,"</p>\n";
            
            echo 
"<p>",$vCapacity,"</p>\n";
            echo 
"<p>",$Dresscode,"</p>\n";
            echo 
"<p>",$Category,"</p>\n";
            echo 
"<p>",$Restriction,"</p>\n";
            echo 
"<p>",$Genre,"</p>\n";
            

        echo 
"<p>\n";
        if(
$vRatingnumber >0){
            
$vRatingaverage round(($vRatingtotal/$vRatingnumber), 1);
        }else{
            
$vRatingaverage =0;
        }
        echo 
"Current Venue Rating: ",$vRatingaverage,"/5 - ",$vRatingnumber," votes\n";
        echo 
"</p>\n";
        
    }
        
        
?>

Any help would be greatly appreciated, thanks Craig.

Last edited by chrishirst; 09-04-2010 at 10:38 AM..
Hicki is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-02-2010, 05:01 PM Re: Unknown column '****' in 'field list'
Extreme Talker

Posts: 173
Trades: 0
Is Dresscode in the table that you are trying to access?
dgkindy is offline
Reply With Quote
View Public Profile
 
Old 09-02-2010, 07:26 PM Re: Unknown column '****' in 'field list'
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
AND if your server is running on *nix column and table names are case sensitive. So "Dresscode" and "dresscode" are NOT the same thing.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-03-2010, 11:07 AM Re: Unknown column '****' in 'field list'
Junior Talker

Posts: 2
Name: Craig
Trades: 0
Hi guys, thank you for the response.. the field is Dresscode and does exist and is in the table in question. The error message has now cleared and been replaced with my new favourite

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in ....

As i'm very new to the PHP again i've managed to fix a few different issues, but now this one has me stumped. I've checked many disscussions online, i'm getting the feeling the error is due to a lack of error handling for the array in question, but i'm not sure..

Thanks for the responses with regard to the initial problem. Any opinions on the new error with regard to the same code would be hugely appreciated (',)
Hicki is offline
Reply With Quote
View Public Profile
 
Old 09-03-2010, 07:23 PM Re: Unknown column '****' in 'field list'
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
Line numbers or better yet highlighting the line causing the error will help immensely!
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Old 09-04-2010, 08:51 AM Re: Unknown column '****' in 'field list'
Novice Talker

Posts: 12
Name: chris
Trades: 0
Quote:
Originally Posted by Sleeping Troll View Post
Line numbers or better yet highlighting the line causing the error will help immensely!

Looking at the coding above there will only be one line number i dont see another query to constitute multiple line possibilities - scrap that i spotted more i should read more closely


IF you want to you can perform an sql dump of the table only dont bother with the data its unimportant.

post the resulting create table coding here for further inspection. maybe our eyes can see what you might be missing

Last edited by cdjhosting; 09-04-2010 at 08:55 AM..
cdjhosting is offline
Reply With Quote
View Public Profile
 
Old 09-04-2010, 10:40 AM Re: Unknown column '****' in 'field list'
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in ....
Means that the query returned true || false rather than a recordset.

Assuming it is this:
PHP Code:
$venue_info mysqli_fetch_array($venue_data); 
; echo out the value of $venue_data to see what it contains.

oh and use code delimiters please NOT text formatting.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Unknown column '****' in 'field list'
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.39049 seconds with 12 queries