Here's what i made:
5,'WA'=>7,'OR'=>8);
$states=array('CA','WA','OR');
function calctax($amount, $st)
{
global $taxrate;
global $states;
$tax=$amount*$taxrate[$st];
return $tax/100;
}
$amnt=200;
foreach($states as $st)
{
print "Tax in $st for amount $amnt is ".calctax($amnt, $st);
print "\n";
}
?>
Wat is the problem with this code.
- Original Message
From: Abhisek Dutta <[EMAIL PROTECTED]>
To: php-windows@lists.php.net
Sent: Tuesday, 31 July, 2007 3:07:06 PM
Subject: Re: [PHP-WIN] Arrays past to functions
Here's what i made:
5,'WA'=>7,'OR'=>8);
$states=array('CA','WA','OR');
fu
Thanks do much for all your help and support. Seems like my zonealarm
was blocking the port. after i uninstalled the program mysql is running
smoothly.
~regards and thanks
Abhisek
James Crow wrote:
try:
telnet localhost 3306
or
telnet 127.0.0.1 3306
"telnet 3306" tells windows to telnet to a
Sorry, this seams very trivial but I can not sort the result set for any
field. What am I doing wrong?
php & mySQL 5
'
}
?>
1
2
3
4
TIA
Mark
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Well, it looks like you're trying to get your results in an array and run
the query all at the same time. Also, I believe you need to put the variable
in your SELECT statement inside of some single quotes.
Try something like this:
$query = "SELECT * FROM '$table_name' ORDER BY DESC";
$result = my
I can't really see anything wrong with what you have there. It shouldn't
matter that your SQL is inside the query function, although I like to build the
query in a variable outside the query function, but either way it should work.
And you're obviously getting data and not an error, right?
Wha
Spaces would affect sorting if the spaces appeared in the actual rowID data.
If rowID is stored as text of some kind, then yeah, maybe he'd have an issue.
But I have a feeling you're talking about the code itself and whether to put
the quer into a variable or not (rebuting what I said).
Here'
Is mysql_fetch_array the proper function to access sorted data?The
problem is consistent on my test server and my ISPs mySQL DB.
rowID is the primary key. Do I need to have an index attribute on a field I
want to sort?
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I can'
Ha hawellthat's slightly embarrassing! But turns out it's not
the issue after all. It must be the permissions issue, but
unfortunately I haven't had a chance to get back and test it.
Thanks for that.
Regards,
Bruce
>>> Gustav Wiberg <[EMAIL PROTECTED]> 30/07/2007 6:14:00 p.m. >>>
Hi
I'm kind of trying to do this quickly. Can anyone give me some PHP code that
will let me link to a different image if $veriable = blah blah blah. I need
it for 4 different options.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
also when the user registers. is there a peice of code that will let me send
myself and e-mail informing me?
""Stephen"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm kind of trying to do this quickly. Can anyone give me some PHP code
> that will let me link to a different im
Hi!
I really didn't thought that would be the issue, but I thought I had to mention
it anyway :-)
Best regards
/Gustav Wiberg
-Original Message-
From: Bruce Cowin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 01, 2007 12:55 AM
To: 'Stut'; Gustav Wiberg
Cc: 'php-windows@lists.php.n
Hi!
If you need help in programming an application from scratch this might not be
the list for you :-)
Best regards
/Gustav Wiberg
-Original Message-
From: Stephen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 01, 2007 4:41 AM
To: php-windows@lists.php.net
Subject: [PHP-WIN] Re:
Hi!
I can't see anything with your code either. Mysql_fetch_array should work fine
yes. No indexes are needed to sort fields, but are recommended for speeding up
the process :-)
How does the table users look like? (Please send a link to a screenshot or
something like that)
Sometimes I have no
14 matches
Mail list logo