473,385 Members | 1,907 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,385 software developers and data experts.

mysql_fetch_assoc not returning null columns.

i have an array that is pulling down information from a database that has null values. how can a get the mysql_fetch_assoc to recognize this null value as just empty space to fill in a form as white space? right now it just skips past like it doesnt recognize the column is there at all.

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. while($row = mysql_fetch_assoc($result)) {
  4.  
  5.  
  6.  
  7. echo "<customer_id>" . $row['customer_id'] . "</customer_id>";
  8.  echo "<gender>" . $row['gender'] . "</gender>";//
  9.  echo "<language>" . $row['language'] . "</language>";//
  10.  echo "<birthdate>" . $row['birthdate'] . "</birthdate>";//
  11.  echo "<contact_id>" . $row['contact_id'] . "</contact_id>";//
  12.  echo "<insur1_id>" . $row['insur1_id'] . "</insur1_id>";//
  13.  echo "<insur2_id>" . $row['insur2_id'] . "</insur2_id>";//
  14.  echo "<guardian_id>" . $row['guardian_id'] . "</guardian_id>";// this is null
  15.  echo "<hearloss_id>" . $row['hearloss_id'] . "</hearloss_id>";
  16.  echo "<equipment_id>" . $row['equipment_id'] . "</equipment_id>";
  17.  
  18.  
Nov 26 '08 #1
2 2445
dps225
7
It looks like you're building an XML document from your query results. Are you then using that to pre-populate a form? Is one of the lines in that example code not being echoed or is it one of the form fields not being appropriately populated?
Nov 26 '08 #2
Markus
6,050 Expert 4TB
Please refrain from using "PLEASE HELP!!!!", etc., in your title. Also be as descriptive as possible in your title to help others.

Moderator.
Nov 26 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Ellen Manning | last post by:
Using SQL2000. I want to return the # of columns with non-null values. Here's my query so far: select case when Dx1 is not null then 0 else 1 end + case when Dx2 is not null then 0 else 1 end...
12
by: Jeff North | last post by:
I'm stumped and my brains are fried!!!! I have the following data +-------+------------------------------+------------+ | resID | FLEName | VersionNbr |...
0
by: George Durzi | last post by:
cross posted in datagrid group. Inside <columns/> in my datagrid, I have the following template column <asp:templatecolumn HeaderText="To Be Completed By"> <itemtemplate> <asp:Label...
1
by: Dave | last post by:
I am relativly new to visual basic, so this may be a no- brainer. I am attempting to use a computed column in a VB dataset defined as followe: ' 'dcCost ' Me.dcCost.ColumnName = "Cost"
3
by: Thirsty Traveler | last post by:
I have a gridview where the datasource is bound after a selection. The result of doing this is that sorting and paging do not work. I was given a sample of how to resolve this, however my attempt...
0
by: Maart_newbie | last post by:
Hi all, I've got a question about returning the value of a pk-column to a DataTable after inserting a row (via a data-adapter) using MySql5. Here is the SQL and code concerned: ...
5
by: clodhoppers18 | last post by:
I am trying to get the following code to work, and I am having some problems: The code goes for actually 110 lines, but I have dismissed what is not needed. The connection and all that works for...
1
by: bytesFTW99 | last post by:
Ok I have a problem! i have a mysql_fetch_assoc that does not recognize the NULL value of the column. however, i want this null to be picked up so i can use it. how can i go about doing that? ...
2
by: poreko | last post by:
I am connecting to my database using Object oriented PHP. My query is returning results but at the end of my table,at the bottom of the page I keep having this error when I run my program: Warning:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.