I really haven't found normal example of PHP file where MySQL transactions are being used. Can you show me simple example of that?
And one more question. I've already done a lot of programming and didn't use transactions. Can I put a PHP function or something in header.php that if one mysql_query fails, then the others fail too?
...
Hi everybody,
How do you use a php variable (array) inside a mysql select statement?
I am designing an auction site and currently working on a page that lets people view a list of all the current bids for an item. I want to display 3 columns:
amountbid - the amount each bidder has bid for the item (held in tblbid)
b...
I am trying to parse this array data that way generated from JQuery and JSON.
Array
(
[d] => Array
(
[0] => Array
(
[order] => 1
)
[1] => Array
(
[order] => 2
)
[2] => Array
(
[order] => 3
...
I'm sending files in action helper for downloads (in parts if needed) like this:
...
$response->sendHeaders();
$chunksize = 1 * (1024 * 1024);
$bytesSent = 0;
if ($httpRange) {
fseek($file, $range);
}
while(!feof($file) &&
(!connection_aborted() &&
($bytesSent < $newLength))
) {
$buffer = fread($file, $chunksize);
// ...
Hello,
Found out today that Twitter will be discontinuing its basic authentication for its API; the push is now towards OAuth but I don’t have a clue as to how to use it or whether it’s the right path for me.
All I want to be able to do is post a tweet linking to the most recently published post when I hit publish. Currently I’m sendin...
I tried to get URL with curl. Return value contain unicode character. curl convert to \u for unicode character. How to get unicode character with curl ?
This is my code
<?php
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://www.ornagai.com/index.php/api/word/q/test/format/json");
curl_s...
How to determine the difference among dates of birth?
+----------+----------+------------+
| id | name | birth |
+----------+----------+------------+
| 00001 | Claws | 2010-04-17 |
| 00002 | Claws | 2010-01-31 |
| 00003 | Claws | 2009-11-31 |
| 00004 | Claws | 2009-09-31 |
| 00005 | Claws | ...
Error:
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'images/xxx/xxx.jpg' for writing: Permission denied in /usr/www/users/xxx/resources/func.createthumbs.php on line 48
images/xxx/xxx/xxx.jpg
Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/xxx/resources/updatethumbs.php...
edited:
This is what i need:
sendpost = function(a,b,c){
return jQuery.post('inc/operations.php', {a:b}, c, "json");
},
rotate = function(callback){
//....
alert(callback);
}
sendpost('operation', 'test', rotate)
old post:
i use this function to return the response of post:
$.sendpost = function(){
return jQuery.pos...
Hi guys, I'm trying to connect to the pop3-server with php. Here is my code:
$pop3Server = 'mail.roller.ru';
$pop_conn = fsockopen($pop3Server, 110, $errno, $errstr, 10);
print fgets($pop_conn, 1024);
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/...
Hi guys, I have another one problem with pop3. Here is connection to pop3-server:
$pop3Server = '62.113.86.215'; // mail.roller.ru
$pop3User = 'mail-robot%roller.ru';
$pop_conn = fsockopen($pop3Server, 110, $errno, $errstr, 30);
echo fgets($pop_conn, 1024);
It returns OK. The next step is login:
fputs($pop_conn, 'USER '.$pop3User.'...
Well, the following returns what date was 5 days ago:
$days_ago = date('Y-m-d', mktime(0, 0, 0, date("m") , date("d") - 5, date("Y")));
But, how do I find what was 5 days ago from any date, not just today?
For example: What was 5 days prior to 2008-12-02?
...
What is the reason of the error on title? I tested mysql query at Mysql Front and no problem. My script is below. Thank you.
$fbFoodPerma = $fbSiteID."-".$fbFoodPerma;
$sql = mysql_query("
SELECT fbFoodPerma
FROM fbFoods
WHERE fbFoodPerma
LIKE '$fbFoodPerma'") or die(mysql_error());
...
This is another noobish mistake from me but I've placed some text in my page but after adding some padding to my div tag it's impossible for me to place my Text in the vertical center. Here is a preview of my problem:
The CSS:
body {
background-image: url(../images/body-bg.jpg);
font-family: arial;
}
.cms-head {
backgrou...
Previously, my intention was to ask:
Do you know any open source SQL formatter/beautifier library for PHP projects?
But I think, I'd better ask:
Which code formatting libraries written in PHP are the best?
Let's list them all in one place.
My types:
for CSS syntax: Css Tidy
for PHP: PEAR's PHP_Beautifier
for HTML syntax: Tidy
E...
Hi,
I am learning cakephp in an autodidact manner and I am a complete newbie :) I am creating a simple application. Some logic work so now I going to dive into designing views and layouts.
I read the docs and the tutorial but I could not find where to set the content of $script_for_layout.
Especially I want to set a $html->css to create...
When C# app is ran, it POSTS a request to the PHP server, which wants to return an array. What's an easy way to load this array's contents into C# for using with there.
For clarification, this array is a PHP stdClass object that contains strings, floats, and other stdClass objects. I want to get a similar data structure on the C# end ...
Hello all,
I have a function that will be passed in a link. The link is to a remote image. I thought I could just use the extension of the file in the URL to determine the type of image but some URLs won't have extensions in the URL. They probably just push headers to the browser and therefore I do not have an extension to parse from t...
Hi, im now using namespaces in PHP 5.3 now there is a fallback mechanism for functions which dont exist in the namespace. so php every time checks if the function exists in namespace and then tries to load it from global space.
So what about all php internal functions? strstr for example?
Should i now use every php internal function wit...
Hi,
Using CodeIgniter, how do I access and display text entered into an input field on a view file (see code below) from my controller file?
// input_view.php
<?php
echo form_open('search/submit');
$input_data = array('name' => 'search_field', 'size' => '70');
echo form_input($input_data);
form_submit('subm...