Jump to content

Philip

Staff Alumni
  • Posts

    4,665
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by Philip

  1. Or if outside the current tags and you don't want it to be executed: just use < for < and > for >
  2. If you use prepare you do not need to escape the quotes - however if you're using normal query you do.
  3. mrMarcus - actually if the column is of numeric type it is not needed to place single quotes around the value. However, you are right with regards to never directly putting any request variables in the query
  4. haha, fetch_attay?
  5. You're not calling a fetch from the database. $query = mysql_query("SELECT `something` FROM `somewhere` LIMIT 1"); $row = mysql_fetch_assoc($query); echo $row['something'];
  6. You'd need to have js change it to display: block; jquery will have built in features that will do that... here's a tutorial/code sample: http://www.learningjquery.com/2006/09/slicker-show-and-hide
  7. You could set it's visibility property to none: display: none;
  8. You need to use sessions or a database/flat file to continue using a value across multiple scripts. Static reads as following:
  9. What's your current code then?
  10. You need to double check you parenthesis on your if statement, they don't line up (error_reporting would have found this ) Hopefully color coding the parenthesis will help you find your errors (and yes, the ones that don't line up are bolded and underlined): Also, on your query: $query = "INSERT INTO bookings (bookTitle, date, bookStart, bookEnd, bookLanes) VALUES ('$_POST[booktitle]','$_POST[date]','$_POST[bookStart]','$_POST[bookEnd]','$_POST[bookLanes]')"; Make sure to use curly brackets { } or concatenate the variables with a period: $query = "INSERT INTO bookings (bookTitle, date, bookStart, bookEnd, bookLanes) VALUES ('".$_POST['booktitle']."','".$_POST['date']."','".$_POST['bookStart']."','".$_POST['bookEnd']."','".$_POST['bookLanes']."')";
  11. Yeah, more of a SMF bug though. See if one if the admins is willing to try the fix
  12. Haha, I tried. Yours went away just fine Oh and from SMF board (although a 1.x):
  13. We've built our own, but we typically use http://rackmountsetc.com/ If you went with only Dell/HP - meh.... We also need to know what your budget looks like. We could set you up with an awesome server, and then you tell us its way overpriced. Just a quick look at what I did on dell.com: 2x quad core 2.33GHz Xeons (same ones I have - which are pretty quick haha), 4GB of RAM, 4x 500GB drives @ RAID 10, so 1TB of space backed mirrored all for $3.5k. It's an okay price, mainly the CPUs & HDD ate up your budget.
  14. $query = mysql_query("SELECT name FROM users LIMIT ".($num-1).", 1");
  15. Well - ip2long kinda does that. Returns false on invalid IP - but I agree, it would be nice to have a built in function is_ip
  16. $array = str_split($string);
  17. SELECT name FROM users LIMIT 5,1 would grab row 6
  18. Solved button is in the bottom left corner of the page, under the thread
  19. $words=(str_replace ($punc) ' ')); Isn't correct syntax. Take a look: str_replace()
  20. <?php $word1 = "php freaks"; $word2 = "phe"; echo str_replace(str_split(strtolower($word2)), '', strtolower($word1)); ?> I added strtolower to keep case out of it the mix (p != P)
  21. $original = array(1,2,3,4,5,6,7,8,9,0); $temp = array(); foreach(array_chunk($original, 4) as $k=>$v) $temp[] = implode($v); echo implode('-', $temp); Displays:
  22. Haha, I admit I did. Creepy thought that maybe one day somebody would be doing the same thing to me - and as soon as I thought that I closed the window, haha
  23. Place it right after your query.
  24. Make sure to have session_start(); at the top of both scripts. Then, setting the session: $_SESSION['last_invoice'] = mysql_insert_id();
  25. See the [tweaked] example on the page I linked to: mysql_query("INSERT INTO mytable (product) values ('kossu')"); echo "Last inserted record has id ", mysql_insert_id();
×
×
  • 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.