When I want to remove a Cookie I try unset($_COOKIE[‘hello’]); I see in my cookie browser from firefox that the cookie still exists. How can I really remove the cookie?
Category: Questions
how to detect search engine bots with php?
How can one detect the search engine bots using php? Answer Here’s a Search Engine Directory of Spider names Then you use $_SERVER[‘HTTP_USER_AGENT’]; to check if the agent is said spider.
How to solve “Fatal error: Class ‘MySQLi’ not found”?
I am doing a tutorial and am getting this error: Fatal error: Class ‘MySQLi’ not found (LONG URL) on line 8 The code on line 8 is: $mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name); …
Combine PHP prepared statments with LIKE
Anyone know how to combine PHP prepared statements with LIKE? i.e. “SELECT * FROM table WHERE name LIKE %?%”; Answer The % signs need to go in the variable that you assign to the parameter, instead of in the query. I don’t know if you’re using mysqli or PDO, but with PDO it would be something like: For mysqli user
Serial comm with PHP on Windows
I am looking for a way to communicate with RS232 serial COM port on windows. I have found 2 solutions on the net, one which is not totally free (introduces deliberate delays on the function) and …
How to bind mysqli parameters using loop and store results in array?
The code above gets the value from genreID when dbGenre is equal to $genre. And then store the results in an array. But it’s not working because $genre is an array, so I need to loop through it to get a different value from genreID each time. The ‘genres’ table contains two columns: genreID (INT) and dbGenre (VARCHAR) I just
What’s the most efficient test of whether a PHP string ends with another string?
The standard PHP way to test whether a string $str ends with a substring $test is: $endsWith = substr( $str, -strlen( $test ) ) == $test Is this the fastest way?
How to know for sure if FastCGI is being used to run php scripts
I have a hosted site and I’m having trouble configuring Joomla (running Joomla + php + mySQL on IIS7 + win server 2008). I have a similar configuration running on a local machine (Joomla + php + mySQL on IIS7 + vista x64), so I was at least able to follow instructions showed in various tutorials on how to set
How can I count the numbers of rows that a MySQL query returned?
How can I count the number of rows that a MySQL query returned?
Select from MySQL records that sums
I’m using PHP and MySQL. I have a table named quantity. Inside there are records of product name, product price and product quantity. Besides these, there are a few others that helps me select the last records based on date and position, as well as a GROUP BY the field named price because there are different quantities with different prices