php5

mysql remote connection issues ? How to connect using php?

hi, I am trying to connect remote mysql i am having typical issue. $conn = mysql_connect('xxx.xxx.xxx.xxx', 'username', 'password') or die(mysql_error()); Let my system host name is my.host.com and remote one is remote.host.com I tryed using both IP xxx.xxx.xxx.xxx and remote.host.com it is saying that Access denied for user 'usern...

How to handle Frameset, POST & Re-Direct

I am using FrameSets to divide screen into two panes. The left pane displays links whereas the right pane displays the actual pages. I want to know how to handle the issue when an entry Form is opened on the right-pane and submitted. When I submit a Form, the action is passed to another .php file, which saves the records into MySQL data...

dynamic array key additions (sucky title, i know)

precode: $keys = array('a', 'b', 'c', 'd'); $number = 10; code: eval('$array[\''.implode('\'][\'',$keys).'\'] = $number;'); result: Array ( [a] => Array ( [b] => Array ( [c] => Array ( [d] => 10 ) ) ) ) problem...

CURL with PHP - Very slow

All, I have to request a URL which returns a JSON request. I am using PHP and CURL to do this. Currently it takes around 3-4 seconds for the request and response. Following is the curl code $ch = curl_init(); $devnull = fopen('/tmp/curlcookie.txt', 'w'); curl_setopt($ch, CURLOPT_STDERR, $devnull); curl_setopt($ch, CU...

Is there a more efficient way of coding this?

The code in question is the code contained within the 2nd foreach loop, the purpose of which is to prevent exact duplicate latitude and longitudes. foreach($aUsers as $k => $v) { // generate address $aAddress = array(); if(!empty($v['city_location'])) $aAddress[] = $v['city_loc...

Doctrine issues when using JOIN and WHERE

Hello all, I have a simple doctrine code: $dql = Doctrine_Query::create() ->select('u.ident, u.username, u.email') ->from('Users u, u.Attributes ua'); if ($query) { $dql->where('u.username LIKE ?', "%$query%") ->orWhere('u.name LIKE ?', "%$query%") ->orWhere('u.email LIKE ?', "%$query%"); } $dql->offset($start...

Errors inside of output buffer.

I'm having some problems with the output buffer. I am buffering my script and printing the result using a callback. The problem is that if a error is thrown at any point, nothing is being shown and I am getting a blank screen. I have tried setting my own custom error handlers but nothing seems to work. I have a feeling this is because th...

Creating a cron job in php

hi! i wanna create a cron job which has to execute a file every 30 minutes. I don't have a cpanel or any frontend to do that :( how do i do it? ...

calling a file inside another file in php

hi! i've two files a.php which contains <?php echo "i'm a.php"; ?> and b.php which contains <?php echo "i'm b.php"; // some code here to "execute" a.php so that it prints i'm a.php as the output. ?> so finally, when i click on b.php it should display: i'm b.php i'm a.php ...

Select Particular Date

Hi i want to select a partcular date with month like if jan20-feb22 and if the date is Selected in between that i have to select a particular value like libra or arise and so on??? Just let me knw i want to create a chart for every individual... ...

Posible to make this Code smaller?

Hello everyone I have this Two Methods private function cacheAdd($id,$data) { $this->minicache->set($id,$data); } private function cacheGet($id) { return $this->minicache->get($id); } Each time if i want to check if the items are cached i have to do something like that: public function getFriendIds() { $info = $this->cach...

Sending Web Page through Email in php

as in asp we have function to send complete web page in email, which basically save lot of time for developer in creating & sending email see the following code <% Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From="[email protected]" myMail.To="[email protected]" myMail.CreateMHTML...

return all results from a mysql row seperated by commas matching a value

Hi, I have a mysql table containing news data and categories and i'm trying to slect all data within a certain category. I didn't think far enough ahead so i'm currently not using a normalised table at some point i may go back and re-write that portion to use a normalised table. Here is my table structure +---------+------------+----...

Access Parent object PHP

I have class that extends another class. class TWITTER_FOLLOWERS extends TWITTER_BOT in TWITTER_FOLLOWERS i want to acces the db object from TWITTER_BOT but i get just an error Fatal error: Call to a member function fetch_all_array() on a non-object in /var/www/bot/inc/TWITTER_FOLLOWERS.php on line 163 On line 163 i have this code ...

Convert a date DD-MM-YY and HH:MM vars to RFC-822 using PHP

I have a date variable that contains data in the forma: DD-MM-YY. -> $date I also have another variable that contains the time in HH:MM. -> $time I'd like to convert it to RFC-822 for to be used in a RSS feed. How can I achieve this with PHP? ...

how can we decrypting 128 bit AES encrypted text in php with cipher mode ECB and padding mode PKCS7

i fetched such problem in my project how can we decrypting 128 bit AES encrypted text in php with cipher mode ECB and padding mode PKCS7 ...

Access to non-current-user sessions data in PHP

Is it possible to access data in other users sessions than the sessions which is active with the currently connecting client ($_SESSION)? If so, how? ...

How to retrieve DropDown value when it is posted?

When the Form is submitted, I can retrieve the DropDown text using $_POST['....']. But I want to get the DropDown value not the display member. How to get it using POST? ...

create more object is inconsistent ?

hi, My question may be stupid, but i want to clear my doubt. I am php, mysql developer. While coding one of table requires objects from class A for each row. Say it will create no of objects based on of row. Is this concept is inconsistent ? Class A { function __construct($userid) { } } class B { function action_add($userid) { ...

Why It is not possible to serialize PHP built-in objects ?

I have tried to unserialize a PHP Object. Warning: unserialize() [function.unserialize]: Node no longer exists in /var/www/app.php on line 42 But why was that happen? Even if I found a solution to unserialize simplexml objects, its good to know why php cant unserialize objects? To serialize simplexml object i use this function func...