Only numbers, or letters as well?
| SitePoint Sponsor |





Only numbers, or letters as well?
www.nyanko.ws - My web-, software- and game development company.
www.mayaposch.com - My personal site and blog.





It depends - in PHP, it juggles the types for you. If you say this:
$num = 4.0
It'll convert it to a double, or a floating number (both terms are correct, I believe). I'm pretty sure that something like this:
$num = "4a";
Would be evaluted as "4".
For example:
$one = "4a";
$two = "2";
$total = $one + $two;
// $total equals "6"
However, if $one equals "a4", I believe it then has no numerical value for equestions such as the one given the name of $total.





I see... Thanks, Chris![]()
www.nyanko.ws - My web-, software- and game development company.
www.mayaposch.com - My personal site and blog.

If you're talking databases, then it's numbers only, though I do think depending on the type, it might construe some letters as the sign of the number....





No problem - let me know if my syntax or reasoning is a bit off - I've actually just learned a few of those things in my last post within the last day or so, so I might be mistaken.Originally posted by Elledan
I see... Thanks, Chris![]()





You were right, Dave, I was indeed talking databases (mySQL db, to be precise), but I've now just used 1,2,3 etc. for the integer (first column) and the libraryID/projectID which I'll have to pass in the query-string is now in a fifth column.
Chris, your syntax is fine and I believe your reasoning as well
Thanks, both of your, for your most helpful replies![]()
www.nyanko.ws - My web-, software- and game development company.
www.mayaposch.com - My personal site and blog.
Bookmarks