SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Empty string

  1. #1
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    2,099
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Empty string

    I have the following query to create a multi level drop down menu for events (region, county, city):
    Code MySQL:
    SELECT
      	P.province_eng  
    	, CO.county_eng
    	, C.city_eng
      FROM events E
    	LEFT
      	JOIN provinces P 
        	ON E.province_id = P.province_id   
    	LEFT
      	JOIN counties CO 
        	ON E.county_id = CO.county_id  
    	LEFT
      	JOIN cities C 
        	ON E.city_id = C.city_id
     
      GROUP BY 
      			province_eng
          ,	county_eng
          , city_eng
      ORDER BY
      			province_eng
          ,	county_eng
          , city_eng
    But I get an empty string for city_eng? This is one of my test inserts in the table events:
    Code MySQL:
    INSERT INTO `events` 
    (`event_id`, `province_id`, `county_id`, `city_id`, `event_name_eng`, `event_name_gr`, `event_venue_eng`, `event_venue_gr`, `event_date`, `end_date`, `event_text_eng`, `event_text_gr`, `event_telephone`, `event_email`, `isPending`) 
    VALUES
    (13, 1, 3, 13, 'Test Name', NULL, 'Test Venu', NULL, '2011-01-03', NULL, 'Test', NULL, '26756 6543', 'yourmail@yourmail.com', 1);
    As you can see there is a city_id present in the inser, but somehow It keeps giving me a empty string.
    “Good artists copy, great artists steal” (Pablo Picasso - 1934)

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    My guess is that id (13) isn't present in the cities table

  3. #3
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    2,099
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guido2004 View Post
    My guess is that id (13) isn't present in the cities table
    Hi Guido, unfortunately it is! That was my first of thought as well!
    “Good artists copy, great artists steal” (Pablo Picasso - 1934)

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Really? Did you try that query in PHPMyAdmin (or whatever program you use to manage your database?

  5. #5
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,014
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    donboe, your missing an entry for city_eng in that insert query
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator


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
  •