473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

multiple blank entries?

Hello all, new problem...

When I go to my secondary page of results after I fill info out on a form on
the first, I get 3 blank entries automatically inserted into the mysql
tables. This second form has these blank entries printing up each time even
if I go in to the second page w/o filling out any info on the first. Is
there a way I could prevent these blank entries from being automatically
entered? Like some code that says that if something is blank then not to
have it entered into the tables? or something easier?

thanks in advance!
Jul 17 '05 #1
2 1803
John wrote:
Like some code that says that if something is blank then not to
have it entered into the tables?


Maybe the empty() function?
http://www.php.net/empty

<?php
if (!empty($something)) {
// do insert
}
?>

but ... beware ...

<?php
$something = '0';
if (empty($something)) {
echo 'something is empty!!!!';
}
?>
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
"Pedro Graca" <he****@hotpop.com> wrote in message
news:c2*************@ID-203069.news.uni-berlin.de...

<?php
$something = '0';
if (empty($something)) {
echo 'something is empty!!!!';
}
?>


That would print 'something is empty!!!!' though right? I don't want
anything to print.. like.. if it's blank then it just shouldn't print where
as if there is something there it should print. For instance, say I have a
name as a field.. if someone puts in their name, then it prints.. but for
some reason the table inserts 3 records into itself for no apparent reason
but when I print the record, I don't want those blank fields to print.

Tho what would be easier.. is figuring out why it's inserting those 3 blank
fields in itself in the first place :-)

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John | last post by:
Hey everyone, I keep getting multiple blank records entered along with my data everytime I submit my form. On the first page is the form itself without any code. On the 2nd page that it goes...
15
by: Jack | last post by:
I have a text file of data in a file (add2db.txt) where the entries are already entered on separate lines in the following form: INSERT INTO `reviews` VALUES("", "Tony's", "Lunch", "Great...
2
by: Joe | last post by:
Hey, I'm going to give some background on my situation in case anyone can point out a way around my problem altogether... for the problem itself, please skip to the bottom of the post. thanks....
1
by: Job Lot | last post by:
I have tow columns in my DataTable Date, Amount. What would be the best way to create multiple entries in my DataTable? I am given a start date, end date and an amount. I want to create multiple...
2
by: Jeff | last post by:
I'm trying to create a dynamic form that can have multiple groups of radio buttons (each group has two buttons) with the same name. Essentially, the form allows a user to enter as many names as...
5
by: Sammy | last post by:
On a Windows 2003 Server machine that has multiple IIS web sites, how does one control which web site the new web application gets created under? Thank you, Sammy
4
by: Neo Geshel | last post by:
Greetings I am using VB in my ASP.NET project that uses an admin web site to populate a database that provides content for a front end web site. I am looking for a way to use replace() to...
3
by: Bernard Lebel | last post by:
Hello, Is there an option or a way to allow the selection of multiple entries in the Listbox widget? I could not find any, and would like to allow the end user to select multiple entries. ...
0
by: TechnoAtif | last post by:
<?php include "dbconnect.php"; include "commonFunc.php"; ?> <!----------------------------------> <table width="80%" border="1" cellpadding="2" cellspacing="0"> <tr > <td...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.