Jump to content

t_machine

Members
  • Posts

    104
  • Joined

  • Last visited

    Never

Everything posted by t_machine

  1. hi, can anyone help me with this problem. The script gets a form that posts it's values as an array configuration[]. This is the line that outputs the error. while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) { Any help would be greatly appreciated
  2. Hi, I hope someone can help with this problem. I get the error "Impossible to copy image.gif from to destination directory. I am using an upload form to get image from local computer and upload to the website. Each image I try to upload, I get that error and the image does not upload to the folder. The folder also does have write permission 777. Any help is greatly appreciated. Thanks
  3. hi, I am creating a script that I would like to open a specific file then seach for a phrase (eg. //add text here) then place new codes there. I think the script will need to first check if the file is writable and if not, make it writable then open the file and search for the phrase. It should then close the file and return to previous file permission. Any help on this would be really great. Thanks :)
  4. hi, I would like an example script if possible of how to create download links that expires. I would like to link to my download files but i want the user to have access to that link for only 24 hours. Thanks :)
  5. hi, I am having a little problem sorting the following array example $foo = array('banana'=>'2', 'apple'=>'5', 'grape'=>'8'); How can I sort that array so "apple" shows first then "banana"... before using the foreach ? Thanks :)
  6. Thank you for the reply, yes you are correct it is decrementing. I would like it to be stored that way in the database however. It is needed for a plugin I am creating. The problem is that the user already has positive numbers which would conflict with the plugin unless its negative. Thanks.
  7. hi, I was wondering if it is possible to auto increment negative numbers in a mysql database. I know you can set the field to auto_increment but it will add positive numbers such as 1..2..3..4..5.. but how do i make it negative -1..-2..-3..-4? Thanks
  8. If you need some simple user login scripts you can visit phpclasses.org. There are a number of good ones there.
  9. hi, I am wondering if anyone could help with this problem I have. I have a large list of records, each with the date they were stored in the database. How can I display only the records entered within a certain data period. Example $sql = "SELECT * FROM _table where date_added is between 07,Dec,2006 and 23,Jan,2007 I stored the date as time stamped time().. I think I would have to format the date_added column like this -> DATE_FORMAT(FROM_UNIXTIME(date_added), '%d,%m,%Y') but how do I check if it's between the above time period. Thanks :)
  10. Thank you all very much for the replies :) jesirose, yours worked perfectly. I had to make a minor addition to display the current year, it stopped displaying at 2006 [quote]for($i=2001; $i<date("Y")+1; $i++){   print '<option value="'.$i.'">'.$i.'</option>'; }[/quote]
  11. hi, I am creating a form and i would like the select to contain the start year and all the years between  then and the current year. example: <select name="year">   <option value="2001">2001</option> //How do i get the years in between 2001 to current 2007   <option value="2007">2007</option> </select> The idea would be that the script can auto update the year with each new year but still going back to 2001 as the start date. I hope someone can help with this or if there is a much better way to accomplish this. Thanks :)
  12. Thank you very much :) It works great now.
  13. Hi, I would appreciate if anyone could help with this. I am using the following array of columns in my database query. I am using the sprintf function. This is my array of columns $mytbls= array('id', 'user_id', 'groupid', 'expire'); I would like to use only the groupid from that array in something like the following $sql = sprintf("SELECT %s FROM TABLE_NAME",                   implode(', ', $mytbls)                   ); If I keep it as the above, it will select all my columns but I only need the "groupid". Thanks :)
  14. Thanks everyone for the help :) alpine : Your script is perfect for what I need. Thanks :)
  15. Hi, I am wondering if anyone could help with this problem. I have an array that checks values in post and I would like to check if any of the post field is empty so I can let the user know that they can't post an empty field. I have the following $mycheck = array(); $mycheck['one'] = $var1; $mycheck['two'] = $var2; $mycheck['three'] = $var3; Let's say $var3 is blank, how can I check the array and print that one of the field is empty? Thanks :)
  16. Thank you very much :) Works perfectly now.
  17. hi, I can't seem to figure out why the query is failing. I run it on my local host and it works but when placed online it fails. $wpoints = query_db("select u_id, SUM(points) from table where b_id='2' group by u_id order by SUM(points)"); When I try to get a numrows it shows blank online but on local host it shows the correct amount. The table contains u_id, points and b_id The b_id is a category id, u_id is the user and then points. The u_id is entered a number of times in the table with points. I would like to sum the points for each u_id and order them by the ones with the most points. Any help would be greatly appreciated :)
  18. Thank you for your replies :) It would be very good if someday mysql would include a function like that.
  19. Thank you both :) Yeah, I decided to run a sub query to get back all the groups data.
  20. hi, how would I group in a table but display the rest of the result for each. example: username  |  groupmembership sam          |        2 jessica      |        5 sam          |        7 paul          |        5 how can i group username but display all the groupmembership that they are in? As you can see "sam" is in the table twice but in two different groupmembership. Thanks :)
  21. hi, I am wondering if anyone could help with this problem I am having. I need to check if values in a table match that in an array. example $myarray = array(); $myarray['color']="red"; $myarray['drink']="pepsi"; $query =..... SELECT * FROM tablename Where in_array(column_name, $myarray).... Can something like that work or would i need to display the results first then check if in array? Thanks :)
  22. Hi, I would like to know how to repeat a process during a mysql result. example: I would like the first three results to have text colors: 1.blue 2.red 3.green Then I would like the next three result to repeat the process 4.blue 5.red 6.green Any help would be greatly appreciated :)
×
×
  • 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.