Jump to content

mapleleaf

Members
  • Posts

    250
  • Joined

  • Last visited

    Never

Everything posted by mapleleaf

  1. So I need to create a drop down from an array and I want the name id and value to be the location. My code below creates an array but by default the keys are assigned when i create the drop down. I want to assign the key as the the location too. Any ideas? $options = array(); foreach($query->result() as $row) { array_push($options, $row->location); } Appreciated
  2. I have found a way. A bit more long winded than yours as now i select MONTH(timestamp) as month, YEAR(timestamp) as year and then increase them till i get to time(); Odd mix of php and MySQL functions that I wouldn't recommend hence not posting it. It works well enough.
  3. ok so if i store the dates as DATE in mysql then I can do the calculations for each month using MySQL functions? So to select the average value for each month starting from the first time entered would be something like: $i = date('m',time()); SELECT avg(quantity) as q WHERE user_id = '$uid' AND date_added = CURRENT_DATE - $i MONTH and somehow get that into a while loop up to the present. I can't seem to get my head round Mysql time. Php seems easier.
  4. So i ought to store a mysql timestamp too it seems. Sounds like an easier option.
  5. I am sure this has been asked a lot but my search isn't finding it. My database dates are stored as 1238468578 for example. Is there a MySQL function that can search for feb or march 2009 for example? Basically I need to able to organise entries into each month of the year Tx
  6. It seems my server settings won't allow that. tx anyway
  7. I need to change some settings in the php.ini Do I need the original or can just write a few settings in a new one? like: upload_max_filesize = 32M post_max_size = 32M max_execution_time = 180 max_input_time = 180 memory_limit = 64M nothing else in the file and put it in the public folder?
  8. I use u instead of user_name. Lazy typer!! <?php if(isset($_SESSION['u'])) { $query = "SELECT whatever FROM table WHERE user_name = '{$_SESSION['u']}'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result); echo $row['whatever'] ////etc etc being the fields in your database that you want }else{ echo 'No session set for you. Go login'; } ?>
  9. Thanks all. I will assume all will be well Marking as solved to save on your time.
  10. if(isset($_SESSION['u'])) { Select whatever is related to the the value of $_SESSION['u'] in your database and present it. Make sense?
  11. So we are talking 8mb. That will be more than enough information to carry around on any of my users! Any idea where the 4kb concept may have come from? Perhaps my little brain just imagined it. ???
  12. I read somewhere that a max of 4kb can be stored in a session. Is this correct? I am using a database for my sessions so am not sure where the limit is coming from if indeed there is one. Maybe the 4kb is a max for a cookie?? Anyone??
  13. This line of code just before the form caused the problem <td align="right" valign="baseline > Baseline not closed. OOPs
  14. I wish that was it. I just missed copying my code. I edited the original posting to include that.
  15. Sure. Show your script and it can probably be altered very easily
  16. <form action="http://localhost:8888/CI7H/index.php/home/login" method="post"><font color="#ffffff">User </font><input type="text" name="name" size="6" ><font color="#ffffff"> Pass </font><input type="password" name="password" size="6"><input type="submit" name="login" value="Log in" /></form> It is calling a codeigniter function. Shouldn't make any difference as I can't get it to call any pages at all. This just does nothing. No can't find page. Nothing. Source code looks correct except firefox does show the action url in red. In firebug I can't see any errors.
  17. Solved. Simply don't echo back the password. Simple.
  18. I am sure this is simple. New to codeigniter. When the form validates and sends the invalid inputs back it sends passwords too. As i sha1 them in the validation process they get displayed as sha1 back to the user. This won't work. Can I validate and not send back some variables or do the sha1 before: $this->db->insert('members', $_POST); Help much appreciated. Not an OO programmer yet.
  19. Try increasing your max upload size to 8mb. It is probably at 2mb. Also are you sure execution time is enough? Default is 30 which ought to be enough
  20. $query = "UPDATE users SET rank = 'Akatsuki' WHERE id = 'whatever'"; Missing SET I think
  21. I normally do look at the manual first but not this time obviously. Works now. Thanks Yesideez
×
×
  • 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.