
Philip
Staff Alumni-
Posts
4,665 -
Joined
-
Last visited
-
Days Won
20
Everything posted by Philip
-
Or if outside the current tags and you don't want it to be executed: just use < for < and > for >
-
Question: mysql_real_escape_string with PDO statements
Philip replied to cunoodle2's topic in PHP Coding Help
If you use prepare you do not need to escape the quotes - however if you're using normal query you do. -
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
-
haha, fetch_attay?
-
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'];
-
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
-
You could set it's visibility property to none: display: none;
-
You need to use sessions or a database/flat file to continue using a value across multiple scripts. Static reads as following:
-
What's your current code then?
-
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']."')";
-
[SOLVED] "MESSAGES[1]", but no messages
Philip replied to Maq's topic in PHPFreaks.com Website Feedback
Yeah, more of a SMF bug though. See if one if the admins is willing to try the fix -
[SOLVED] "MESSAGES[1]", but no messages
Philip replied to Maq's topic in PHPFreaks.com Website Feedback
Haha, I tried. Yours went away just fine Oh and from SMF board (although a 1.x): -
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.
-
[SOLVED] Is there a way of selecting data from a particular row number?
Philip replied to madspof's topic in MySQL Help
$query = mysql_query("SELECT name FROM users LIMIT ".($num-1).", 1"); -
How to identify if the input string is valid IP address format
Philip replied to bloodgoat's topic in Regex Help
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 -
$array = str_split($string);
-
[SOLVED] Is there a way of selecting data from a particular row number?
Philip replied to madspof's topic in MySQL Help
SELECT name FROM users LIMIT 5,1 would grab row 6 -
$words=(str_replace ($punc) ' ')); Isn't correct syntax. Take a look: str_replace()
-
$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:
-
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
-
[SOLVED] How to Identify last record INSERTED into mySQL..
Philip replied to A JM's topic in PHP Coding Help
Place it right after your query. -
[SOLVED] How to Identify last record INSERTED into mySQL..
Philip replied to A JM's topic in PHP Coding Help
Make sure to have session_start(); at the top of both scripts. Then, setting the session: $_SESSION['last_invoice'] = mysql_insert_id(); -
[SOLVED] How to Identify last record INSERTED into mySQL..
Philip replied to A JM's topic in PHP Coding Help
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();