Welcome Guest, Not a member yet? Register   Sign In
If data exists in the field print, else don't
#3

[eluser]zebake[/eluser]
Wow, fast response, thanks Jedd!
[quote author="jedd" date="1246508924"]
So you can have your second lump of LI's wrapped in a conditional and just test for whether your _alt stuff is present (isset() should do it).
[/quote]
I think I can figure this part out, thank you.

[quote author="jedd" date="1246508924"]
You may want to investigate the helpers, though, as they can provide a bit nicer code for pushing out a bunch of list items.
[/quote]
I will look more into helpers, as well.

[quote author="jedd" date="1246508924"]
You may also want to reconsider your database schema - feel free to post it - as I suspect you are doing this inefficiently (I'm guessing that you have two address fields per person, right?).[/quote]
You're absolutely right, I know there has to be a more efficient / logical way of doing this. Currently I have one table 'students', with 21 fields in it.
Code:
CREATE TABLE IF NOT EXISTS `students` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `student_lname` varchar(255) DEFAULT NULL,
  `student_fname` varchar(255) DEFAULT NULL,
  `parents` varchar(255) DEFAULT NULL,
  `street` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `state` varchar(255) DEFAULT NULL,
  `zip` varchar(255) DEFAULT NULL,
  `email1` varchar(255) DEFAULT NULL,
  `email2` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `cell` varchar(255) DEFAULT NULL,
  `parents_alt` varchar(255) DEFAULT NULL,
  `street_alt` varchar(255) DEFAULT NULL,
  `city_alt` varchar(255) DEFAULT NULL,
  `state_alt` varchar(255) DEFAULT NULL,
  `zip_alt` varchar(255) DEFAULT NULL,
  `email1_alt` varchar(255) DEFAULT NULL,
  `email2_alt` varchar(255) DEFAULT NULL,
  `phone_alt` varchar(255) DEFAULT NULL,
  `cell_alt` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
I also have the feeling I am trying to reinvent the wheel. I searched through the ignited code forum for some type of contact database that I could modify, but I couldn't find anything. In the end, I will be better off building it myself as I obviously need the knowledge. Wink


Messages In This Thread
If data exists in the field print, else don't - by El Forum - 07-01-2009, 05:00 PM
If data exists in the field print, else don't - by El Forum - 07-01-2009, 05:28 PM
If data exists in the field print, else don't - by El Forum - 07-01-2009, 06:15 PM
If data exists in the field print, else don't - by El Forum - 07-01-2009, 06:24 PM
If data exists in the field print, else don't - by El Forum - 07-01-2009, 06:36 PM
If data exists in the field print, else don't - by El Forum - 07-01-2009, 06:52 PM
If data exists in the field print, else don't - by El Forum - 07-01-2009, 09:00 PM
If data exists in the field print, else don't - by El Forum - 07-01-2009, 09:12 PM
If data exists in the field print, else don't - by El Forum - 07-01-2009, 09:13 PM
If data exists in the field print, else don't - by El Forum - 07-01-2009, 09:50 PM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 03:20 AM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 03:29 AM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 03:40 AM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 05:51 AM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 08:02 AM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 08:16 AM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 08:22 AM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 08:31 AM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 08:34 AM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 09:16 AM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 01:07 PM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 01:22 PM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 01:23 PM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 03:29 PM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 03:37 PM
If data exists in the field print, else don't - by El Forum - 07-02-2009, 05:09 PM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 12:44 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 12:55 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 03:58 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 08:01 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 08:16 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 09:00 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 09:33 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 09:49 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 10:01 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 10:08 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 11:01 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 11:08 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 11:38 AM
If data exists in the field print, else don't - by El Forum - 07-03-2009, 11:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB