RE: [PHP] Query Results Question

From: Date: Wed, 04 Aug 2004 01:34:11 +0000
Subject: RE: [PHP] Query Results Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-192649@lists.php.net to get a copy of this message
> Richard. > Public. I changed it to "Publish". > But if I use a query window to interrogate the database I still get just two rows using the following query with field names not values for the row cell contents: > SELECT 'ID','Vacancy_Role','Vacancy_Salary','Vacancy_Location','Vacancy_Type' FROM vacancy_details WHERE Publish='Yes' Take out the quotes. Make your query say: SELECT ID,Vacancy_Role,Vacancy_Salary,Vacancy_Location,Vacancy_Type FROM vacancy_details WHERE Publish='Yes'; Also, if you are selecting every field, then why not do a SELECT *? ----------------------------------------------------------------- Thank you, Richard Bewley rbewley@eq-sys.com Equinox Systems and Development Website: http://www.eq-dev.com/ Also, please look at our webhosting services, specializing in business web hosting starting from $15 per month! -- ----------------------------- Michael Mason Arras People www.arraspeople.co.uk ----------------------------- "Richard Bewley" <rbewley@eq-sys.com> wrote in message news:php.general-192646@news.php.net... > > Richard > > > Thanks firstly for your help. I renamed the fields so the spaces are > underscores and amended your query but still receive an error: > > > "not a valid MySQL result resource " > > > Still tinkering though... > > Can you paste me > a.) Your database structure > b.) The exact query you are using > > Also, you may want to do $query = mysql_query("SELECT * from > vacancy_details") or die(mysql_error()); > > I don't care about the first part of that, but try putting in the > mysql_error() in the form I used above, and see if it gives you any other > information. > > ----------------------------------------------------------------- > Thank you, > Richard Bewley > rbewley@eq-sys.com > > Equinox Systems and Development > Website: http://www.eq-dev.com/ > > Also, please look at our webhosting services, specializing in business web > hosting starting from $15 per month! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#192649) next »