Jump to content

xProteuSx

Members
  • Posts

    476
  • Joined

  • Last visited

Everything posted by xProteuSx

  1. xcoderx, I cannot use a button ... it must be an <a href=""></a> thing because I am using an image as the button. Any ideas?
  2. Usually I can figure this out, but I am completely stumped. Say I have a function like this: whatever = new function() { alert("Yay"); } Then I have a link like this in the HTML: <a href="javascript:whatever()">Say Yay!</a> Why does this not work for me???? Please help! Thank you in advance.
  3. Thanks for your reply PFMaBiSmAd. I actually figured out an easier way: I went into phpMyAdmin and changed the collaction of the 'pick' column from latin_swedish_ci to utf_bin. I think that forces all SELECT queries to handle the data from the column as binary data. Anyways, it worked, but I do thank you for your reply!
  4. I have read a few replies to similar questions on this forum, and I only got more confused ... My query looks like this: "SELECT * FROM notes WHERE country = '$country' AND pick = '$pick' AND year = '$year'" I need the pick='$pick' to be case sensitive. I have lots of instances where I have data like '1a' and '1A' but they are not the same. In the database, 'pick' is a varchar data type, and the '$pick' php variable is a string. Is there an easy way to do this? There's got to be ... Thanks in advance.
  5. Usually I wouldn't waste my time, but here goes: I did not ask you to write any scripts for me. Refer to the original post if you're confused about this. And yes, I will work my way through this, and will do so happily. I will probably come back to these forums for help if needed, because the help I have received here is exemplary for the most part (and I return the favor whenever possible) ... ... except for those few like yourself, who seem to post unhelpful replies (ie. Question: what color is a banana? Answer: 12). I am leaning towards the user rating for posts such as yours. The more you get, the better your title, the better you feel about yourself? Please, don't waste anyone's time with 'write some code that will do that' answers.
  6. I'm sorry to say, but that's not very helpful. If I was good enough at PHP I would not be in the forum asking if there was a function that did this, would I? I have no idea how to even go about writing such as script because it would get a little complex if the numbers following the 'E' went into double, triple, quadruple digits.
  7. I have, in a database, integers stored in scientific notation, such as '5e+06'. How can I format this number using PHP to output a real integer value, such as 5000000, instead of '5e+06'??
  8. Is there a function that will remove ALL spaces from a string? I am familiar with chop(), ltrip(), and trim(), but those functions only remove spaces from the front and back of a string ...
  9. Can someone point me towards some information on how to order the contents of an array? The values are alphanumeric. Thanks.
  10. Philip, your Majesty, thank you.
  11. I currently have a bunch of dates and times in a database in the following format: 2009-02-25 00:29:55 Essentially, I would like to change the format to: 02/25/2009 Is there a function for this?
  12. I'd be real interested in this solution too. Without writing or implementing a WYSIWYG input everything is kind of simplified. I wonder if making the field Binary would fix this. However, even if it did, the DB would look pretty ugly.
  13. You know, this seems to be automatically 'on' in Internet Explorer. Mozilla is fussy, and takes you back to the top of any page you go 'Back' to. I thought it might just be a browser thing, until I realized that on eBay it works, even in Mozilla/Firefox.
  14. Also, don't forget to put a space between the 'else' and the 'if' (you have elseif in your code). Also, if I am not mistaken rand() is all inclusive, so you should either put: $random_number = rand(0,1); for two choices, or add another 'else if' statement.
  15. No, anchor links is not what I was thinking. Anchor links can be used to get from one part of a page to another part of the same page real quick. I know this, and even use it occasionally. However, this doesn't help me as far as the Back button goes.
  16. I have a PHP based website where some of the pages get quite long, so you need to scroll down and down and down. Now, what I would like is that if someone scrolls down one of the long pages, clicks a link, and hits the back button, the page is there anew, but the visitor is already scrolled down to the point where he clicked on the link. Right now if you hit the back button the you go back a page, but to the top of it. Any ideas how this is done?
  17. genericnumber1, Thanks so much. I can't believe I would get a working solution so fast! I have posted about this previously, and gotten many replies, but I could not get any of them to work. Thanks.
  18. Ok, here we go again! I have been trying to solve this for a while: I have a DB with a column full of numbers. Some of these numbers are very big and, when they are stored in the DB they are stored in the scientific notation format, such as 1000000=1e+06. I would like to take these numbers from a DB, and show them as integers. Right now if I do this: echo $numberfromdb; my output is '1e+06' If I try the following: $numberfromdb = 1e+06; $formattednumber = (int) $numberfromdb; echo $formattednumber; my output is '1' My quick solution was to change the DB column from 'float' type to 'bigint' type. However, I just realized that I have made a big boo-boo. I have several numbers which are fractions in decimal form (such as .50 and .25) and they have all been replaced with the number 1. Should be fun going back through 2300+ entries to fix this. Anyways, I am back to square one. How do I get 1e+06 to echo as 1000000??? Please help! This is very important and semi urgent.
  19. I am wondering if there is any sort of 'if' statement for MySQL. What I am trying to do is something that looks like this: SELECT * WHERE column1 !=' ' So basically I want to select rows where column1 is not empty, or null. I know that I can select all rows, then filter them using PHP, but I would really like to do this using MySQL if possible. Thanks.
  20. Changed the MySQL field from 'float' to 'bigint' and everything worked out after that. Too bad we didn't actually figure out how to convert abbreviated floats to ints.
  21. Well, its just a snippet obviously. I am fetching a record from a database. The value comes from the fifth column, and is assigned to the variable $row[4]. If I echo the variable $row[4] the output I get is: 1e+06 (which is exactly the same way that it is stored in the database, in a float type field; I have a sneaky suspicion that this is the problem). I am trying to expand the number to its original form: 1000000. I could up all the code, but there's a lot of crap to sift through.
  22. I still cannot get this to work. You mentioned that $row[0] = 1e+06; $formattednumber = (int) $row[0]; echo $formattednumber; Returns '1000000'!?!?!? Why does it not do this for me? the output I get is '1'. Please help! This is a vital part of my project!
  23. Yay. Thank you. I was researching float 'stuff' for like 45 minutes at 4 am in the morning!
  24. I can't believe that I forgot how to do this. Its 4am and I can't seem to find anything useful at php.net. I have numbers, that I would like rounded off to two decimal places. For example: .5 should show up as 0.50 1 should show up as 1.00 I thought this was a float thing?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.