Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
| Search | Today's Posts | Mark Forums Read
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 18th, 2006, 04:18 PM
Registered User
 
Join Date: Jan 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help creating tables

I have a online store and here is my probelm:

I need to have product details stored in the DB and pulled into the product decriptions as needed.
Some products need them and some don't, and the ones that do may or may not need all of the feilds so I only want it the add it to the product decscripion if there is info but not give me a bunch of empty fields fo the ones that dont.
 
Old January 19th, 2006, 09:11 AM
Friend of Wrox
 
Join Date: Dec 2004
Location: London, London, United Kingdom.
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Either you use 2 diffrent tables - or you just deal with the empty fields in a diffrent way:
<?php
if ( field_data == "" ) {
?>
<!-- Empty field --!>
HTML here

<?php
}
if ( field_data != "" ) {
?>
<!-- Not Empty field --!>
HTML here
<?php
}




Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Tables in RichTextBox katsarosj Pro VB.NET 2002/2003 13 March 14th, 2014 05:50 AM
Creating tables on the fly Keith Smith Access VBA 1 January 15th, 2008 10:49 AM
creating tables within tables in access??? carswelljr Access 3 August 23rd, 2006 01:21 PM
Creating word tables, PLEASE help :D Cadey VB How-To 1 December 1st, 2003 08:31 AM
Creating Tables Programmatically stu9820 ASP.NET 1.0 and 1.1 Basics 10 October 22nd, 2003 04:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.