Jump to content

mikesta707

Staff Alumni
  • Posts

    2,965
  • Joined

  • Last visited

Everything posted by mikesta707

  1. I'm actually having a great day, finally got my paycheck after weeks of having nothing because of some clerical iussues
  2. http://www.phpfreaks.com/tutorial/basic-pagination
  3. why not just make 2 brs if its less than or equal to?
  4. $string = "blahblah.blahblah.flv"; $tokens = explode(".", $string); array_pop($tokens); $stringNew = implode(".", $tokens); $stringNew .= ".jpg"; echo $stringNew; untested but that should work. edit: fixed a few things, and tested, output: blahblah.blahblah.jpg
  5. I would, instead of having inviduvidual post variables like you do, make an HTML array, so your form should resemble <!-- questions --> <input type="text".... name="Question[]" /> <input type="text".... name="Question[]" /> etc <!-- question ids (assuming they are hidden fields? --> <input type="hidden" name="qid[]" /> <input type="hidden" name="qid[]" /> etc and then you could just loop through each question and corresponding id like so foreach($_POST['Question'] as $key=>$value){ $aid = $value; $qid = $_POST['qid'][$key]; $query = "UPDATE ...... WHERE aid= '$aid' AND qid='$qid'"; //do query }
  6. if you submit a get to the page the form is on, you can just do something like $textbox = '<input .... value="'.$_GET['school_name'].'".. >';
  7. meh, you should definitely learn as much as you can about linear programming, but you don't have to wait to learn OOP. There are many tasks that are more efficient in OOP than linear, and there are many where the opposite is true. It is best to use the best tools you have available for the task, and as you program more things, you will realize whats best, and learn naturally. However, don't get over your head, if you don't feel comfortable with doing OOP, than by all means, just use a linear style for a while. The best way to learn is to do something you're interested in. You seem to want to create your own site. Well I would suggest trying to create a simple site. make a user login system, maybe some admin stuff. progress to a simple content management system (CMS) with comments or some sort of user interaction. Maybe try out Wordpress so you get some experience using other peoples code. Try making a facebook application afterwards. Once you get comfortable with OOP, try making more robust systems than the simple one's you made earlier. Just make sure whatever you're doing is of some interest because boring projects are just... well... boring
  8. same code works perfectly fine for me? did you update the counter? //while loop stuff above $counter++; }//end while sorry forgot to put that, but thought it was obvious btw you may want to set $counter to 1 instead of 0. 0%4 is 0, so the first time the loop runs it will do the //do something every 4 code
  9. that wouldn't really make sense? what would your condition be? just post the code where you set the variable and send the email
  10. variable names don't matter. you could name your variables goboldygook1, 2, and 3 and it would work fine
  11. alright, well im not gonna trod through all your mass of code, so post the relevant code in code or php tags so I can take a look.
  12. ahh thought i say a 1 in your suggestion
  13. oops $counter = 0; while(condition){ if ($counter % 4 == 0){ //do something ever 4 } //do other stuff }
  14. shouldn't it be $_POST['num1'] not $_POST['num']?
  15. try setting the mime type as text/html
  16. $counter = 0; while(condition){ if ($counter % 4 = 0){ //do something ever 4 } //do other stuff } second post like this today
  17. set them to null in the table (rather than a blank value) consult this page for tips on dealing with null values http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html
  18. it would help if you posted the errors
  19. $counter = 0; while (condition){ //stuff if ($counter % 4 == 0){ //do somethign every 4th time } $counter++; } untested but should work. you may need to set counter to 1
  20. well if someone has access to your .cfg file, than they have access to the rest of your files.. no? but look into feof() (or file_get_contents), and try to get the contents of each line of the .txt file, and then come back with whatever issues arise
  21. create a table of categories, and have a column that holds the parent for that category (default it to NULL if you want) thats How I would do it
  22. if its just the values, than a nested foreach loop should do the trick. alternatively you could just concatenate all the values into a string, or use implode, IE $text = implode(',', $array);
  23. pretty much what s0c0 said. $sql = "SELECT email FROM table WHERE id=$id LIMIT 1";//limit to 1 row returned $query = mysql_query($sql); $row = mysql_fetch_assoc($query);//could also use fetch_array or fetch_row i guess, but i prefer fetch_assoc $cell = $row['email'];//$cell now contains the email address just replace table with your table name, and id with whatever the userID column is, and obviously $id with whatever variable you are using that stores the id of the row you want to access
  24. anyone ever use Talend? and integrate it with some Java code. My boss pretty much just threw me in the water without any water wingies, so I'm kind of lost as i've never used this software, or any other ETL software before in my life. Any tuts or tips to get Java working? or at least how to set the class path of some script
  25. well thats what serialize does. How are you doing to be using this textfile? if you just want to store the value of the array so you can access the array again (and use it like an array) than sasa's script is the way to go
×
×
  • 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.