How do I set the isolation level of a transaction to 'SERIALIZABLE' in PHP using mysqli? I have looked everywhere and I can't find any information on it.
Here is an explanation of the isolation levels.
...
I'm writing tests that check that an external service is providing inventory data (on their test server) that I can check out with, and also cancel. This testing is in the travel/hotel world, and I need to place test reservations, then cancel them.
I take the following steps :
1) search for inventory(a hotel room) 90 days in the future
...
I'm having trouble with the logic of taking a paragraph of text and splitting it on words/sentences to send out in multiple text messages. Each text message can only have up to 160 characters. I want to cleanly break a paragraph up.
Here is the solution (thanks Leventix!):
public static function splitStringAtWordsUpToCharacterLimit($st...
This should be simple but I'm a noob and I can't for the life of me figure it out. I'm trying to use regex to match text inside of special open/close tags: [p2][/p2]
So in this text:
apple [p2]banana[/p2] grape [p2]lemon[/p2]
it should match "banana" and "lemon". The regex I've worked up so far is:
(?<=\[p2\]).+(?=\[\/p2\])
But ...
I've got an inventory table that needs to have certain in each row, and then in the last column in each row, i want to loop out each item that was used per a specific inventory update i.e.
one row would have one column for the customername, one column for the date of the inventory transaction, one for the type of transaction, the specif...
I've heard that Visual Studio 2010 Beta 2 has support for PHP. When I load a PHP file though, it has nothing highlighted and is nothing more than a glorified text editor.
Is there a way to enable it?
...
I have an php page with mixed Latin and Arabic characters. The charset declaration tag is in the html code
and the file is saved as UTF-8. All the text is static and in the php file (does not come from a DB or an external source)
When I browse to the site some pages randomly get corrupt in IE and FF and display all question marks. Aft...
Ok, I've got Zend all set up and my hello world pages working.
Personally, I'd rather code this from scratch, but I'm trying to find out how to use Zend to save time when making similar projects over and over again.
I want to:
Admin:
Create multiple admin accounts
Have database-stored admin options that will be available on all php ...
Hi All:
PHP + java script code + flv player:
I am trying to play a .flv video on a web page
and i have the file name to play from mysql data base so i need to use php.
In the code below there is a script that runs a video player (favideo from Adobe)
this video player work fine when the web page have the .html extension and it wont work ...
I'd like to keep this objective and non-argumentative. Read below as to why this is NOT geared towards subjective answers.
An obvious thing to look for when hiring a programmer is experience and knowledge. But what if they're equal?
For instance, if you have two programmers that are both entry level with equally low experience and very...
I've seen the following lines of code and I know what they do, but I don't know how the second line works (and hence how to apply it to another situation).
$user = User::model()->findByPk(123);
empty($user->profile) and $user->profile = new Profile();
The code tries to look up the User from the database, and if there isn't a profile, ...
I am switching to Netbeans for php programming (I currently use gedit).
Some characters from the original source code ( à, á, é, è, etc.) are not shown in Netbeans, regardless of the fount used, and a little quotation mark is shown instead. Those files are shown perfectly in both gedit and firefox.
If I modify the file in Netbeans, cha...
Hi folks,
When calculating a golf handicap differential you are supposed to truncate the answer to 1 decimal place without rounding. No idea why but...
I know how to do this using TRUNCATE() in mySQL
SELECT TRUNCATE( 2.365, 1 );
// outputs 2.3
but I was wondering if sprintf() could do this? The only way I know to work with decim...
I´m working on a huge project at my work. We have about 200 database tables, accordingly a huge number of Models, Actions and so on.
How should I begin to write tests for this?
My biggest problem is, with symfony you can test with the lime framework, which is great. But most of the code writes, deletes or do other things with the dat...
$db_user="root";
$db_host="localhost";
$db_password="root";
$db_name = "fayer";
$conn = mysqli_connect($db_host,$db_user,$db_password,$db_name) or die ("couldn't connect to server");
// perform query
$query = 'SELECT * FROM posts';
$result = mysqli_query($conn, $query) or die ("Couldn't execute query.");
// use returned data
while($row...
I want to display on a wordpress page the total volume of shares traded on the NYSE stock exchange the last 2 weeks that it's been open. What is the best way to go about doing this?
...
I'd like to insert
<?php include_once('google_analytics.php'); ?>
before the closing body tag of about 100 php files. Unfortunately the person who made the site didn't make a header or footer template.
What is the best way to do this? I've tried using grep/find for getting a list of files and piping the results through xargs to se...
My code:
<?php
$pass = "12345";
//checkPass($pass, $user, $length);
$file = file_get_contents("common.txt");
$array = explode("\n", $file);
if(in_array($pass, $array) == true) {
echo "it's in the array";
}
?>
first few lines of the array (i used print_r($array)...):
Array ( [0] => 12345 [1] => abc123 [2] => password [3] => comput...
Fatal error: Allowed memory size of 18874368 bytes exhausted (tried to allocate 1481725 bytes) in __/public_html/includes/database.inc on line 224
I'm having this error occur in Drupal 6 every time I try to edit the following pages (sorry about the xx's):
hxxp://chipkin.com/fs-8700-125-stulz
hxxp://chipkin.com/fs-8700-47-dnp-3...
Hi
I have a php file which when opened browser displays "hello" and nothing more
I want to grab this content so it will display "hello" on a label on the iphone
Can anyone provide a very simple way of doing this, thanks.
...