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

variable issue.

I have a form to dispaly some drop downs. one of the dropdown needs to show value depending on the QueryString in the URL. and it should set the combo value to 1 if the query string is empty.

I tried different things to play with php but it keeps on giving me errors if the querystring is empty. Can some one please tell me how to get it done.

Regards
Ali
Mar 30 '07 #1
3 1077
code green
1,726 Expert 1GB
QueryString in the URL.
Do you mean you are passing the query as a string within a URL variable?
I tried different things to play with php but it keeps on giving me errors if the querystring is empty.
Test the string first with
[PHP]if(empty($_GET['querystring'])){
//ERROR
} [/PHP]
Mar 30 '07 #2
Do you mean you are passing the query as a string within a URL variable?
Test the string first with
[PHP]if(empty($_GET['querystring'])){
//ERROR
} [/PHP]
It worked. thanks a lot.

One more issue I have is at http://projects.starcomsystems.net/golfcenter/
when you open the combo for SELECT TEE TIME, it shows times as 08:00:00, means it is including seconds. instead I want to show the time as "08:00 AM"...
Can you please tell me how to get this done? please note that the values in this combo are being fetched by a mysql database.

Thanks again

Ali
Mar 30 '07 #3
code green
1,726 Expert 1GB
How are you filling your combo. If using php you can use
[PHP]$combovalue = date('h a',$dbDate);[/PHP]for 12hr or capital H for 24hr, but this function requires $dbDate to be a timestamp. If not you may need [PHP]$dbDate = strtotime($dbDate);[/PHP]
Mar 30 '07 #4

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

Similar topics

83
by: Alexander Zatvornitskiy | last post by:
Hello All! I'am novice in python, and I find one very bad thing (from my point of view) in language. There is no keyword or syntax to declare variable, like 'var' in Pascal, or special syntax in...
3
by: Thomas Matthews | last post by:
Hi, While coding programs, I cam about a conundrum regarding variables defined in an iterative loop. The issue is whether it is more efficient to factor the definition out of the loop or...
2
by: Thomas Matthews | last post by:
Hi, I'm getting linking errors when I declare a variable in the global scope, but not inside a function. The declarations are the same (only the names have been changed...). class Book {...
44
by: Mohanasundaram | last post by:
int i = 10; int main() { int i = 20; return 0; } Hi All, I want to access the global variable i inside the main. Is there
7
by: Edward Yang | last post by:
A few days ago I started a thread "I think C# is forcing us to write more (redundant) code" and got many replies (more than what I had expected). But after reading all the replies I think my...
6
by: Mike | last post by:
I have a function that is called when the user clicks the submit button, during this function i also set a varaible to "Y" due to that this function does a post back to the page then redirects....
6
by: Jody Gelowitz | last post by:
I have run into an issue with variable scope within an XSLT document that is translated in VS.NET 2.0. Under VS.NET 1.1 (XslTransform), this code works fine. However, when using VS.NET 2.0...
5
by: strawberry | last post by:
In the function below, I'd like to extend the scope of the $table variable such that, once assigned it would become available to other parts of the function. I thought 'global $table;' would solve...
2
by: Tom | last post by:
I have a textbox on my web form were users can enter in 1 name or many names. The form then validates the name against the database. If the name is valid its then saved into a varaible to be used at...
4
by: AndreH | last post by:
Good day, I have the a bit of an issue with retrieving an object from php's session. I set a session variable "user" from the class User as follows: $user = new User(); // ... do some stuff...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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.