PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 1st, 2000, 09:00 PM
lisettomcj lisettomcj is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 3 lisettomcj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm trying to design a form using PHP3 which will only print results should their be information in the appropriate column in MySQL. I thought the syntax was something like this, but to no avail.

if ($row["column"] == [A-Za-z]){
print ("This column is full")
} else {
print ("This column is empty")
}

Explanation: If there is text in the column, print "The column is full", otherwise, print "The column is empty".

Any advise?

Reply With Quote
  #2  
Old May 2nd, 2000, 05:51 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan
You can check a empty row in different ways.

probably you can isempty() function.
eg:
if (isempty($row["column"])){
print ("This column is empty")
}else{
print ("This column is full")
}


------------------
SR -
shiju.dreamcenter.net

Reply With Quote
  #3  
Old May 2nd, 2000, 10:30 AM
lisettomcj lisettomcj is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 3 lisettomcj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This is what a inserted:

if (isempty($row["minor_a1"])){

print ("</td></tr><tr><td align=right>Minor(s):&nbsp;</td><td>");
print $row["minor_a1"];
print (",&nbsp;");
print $row["minor_a2"];

} else {

print ("");
}

However, the isempty command doesn't seem to be working. I can't seem to locate any documentation on isempty either to help me. Any other ideas?

Reply With Quote
  #4  
Old May 2nd, 2000, 05:51 PM
Cryption Cryption is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 10 Cryption User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Just reverse the logic, and instead of using the isempty() function, just write the if statement with the call to the part of the array you are checking. If it doesn't exist, the if statement will come back false, and voila! you've got yourself your answer and without having to run an unecessary function call! *<(:-{)

------------------
Let me know if this helps, Cryption

[This message has been edited by Cryption (edited May 02, 2000).]

Reply With Quote
  #5  
Old May 3rd, 2000, 07:44 AM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 17
Send a message via AIM to rod k
The reason isempty() isn't working is because there isn't any such animal. The correct function is empty()

Reply With Quote
  #6  
Old May 4th, 2000, 10:33 AM
lisettomcj lisettomcj is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 3 lisettomcj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks Rod k! That seems to have done it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP3 + MySQL

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap