php

Whether to use Stored Procedure of Active Record Pattern in CodeIgniter?

Hello, I learnt that Stored procedures should always be favored over writing direct queries in code (Becaue our database engine caches the execution plan). But, in CodeIgniter i see a new concept of Active Record pattern. Is this execution plan cached in Active Record or every time the database engine has to parse the query? If it is pa...

Grab session variable from php page via jquery?

I edited my original text to demostrate my entire set of code for those that weren't understanding my question. All this works perfect when I had my database use MyISAM but when I changed over to InnoDB I now have to account for my foreign key or the mysql_queries won't successfully execute. I have the user_id in a session variable that ...

Using a different Connection within Doctrine_Table in symfony 1.4 / sfMasterSlavePlugin

Hi all :) In my symfony project i'm working with doctrine for my data models. Also i have the sfMasterSlavePlugin installed to use different connections for different kinds of queries (writes vs. reads). Because of the small delay in mysql's replication my code is failing to fetch a freshly inserted record. To get around this problem i...

php json_encode returning null

Array ( [sEcho] => 1 [iTotalRecords] => 7521 [iTotalDisplayRecords] => 1 [aaData] => Array ( [0] => Array ( [0] => Nordic Capital Buys SiC Processing [1] => 2010-06-21/nordic-capital-buys-sic-processing [2] => PEHub Media ...

[PHP] - Does browser stop/crash halts script execution?

I mean, if a php script/page is invoked by a browser and page load/execution is interrupted by user or by browser crash, does script execution continues on the server side? ...

Installing xampp

I tried to install xampp ( i downloaded xampp-win32-upgrade-1.7.2-1.7.3). after i finish extracting it gives fatal error : failed opening required : G:\xampp\install\xampp_xampp_php' in G:\xampp\setup_xampp.bat on line 33 Did i downloaded wrong archive. im installing on windows 7 64 bit.I dont have any preinstalled xampp. ...

How to combine 2 imagemagick commands together

I got 2 seprate Imagemagick commands (resize and crop circle). Is it possible to combine both commands into single PHP exec. exec('convert original.jpg -resize x100 -gravity center -crop 100x100+0+0 +repage thumbnail.jpg'); exec('convert -size 100x100 xc:none -fill thumbnail.jpg -draw "circle 50,50 50,0" circle.png'); Many thanks ...

How does CodeIgniter output caching work?

Hello, I read this link :- http://codeigniter.com/user_guide/general/caching.html It is written that :- When a page is loaded for the first time, the cache file will be written to your system/cache folder and that we can cache a view by $this->output->cache(60);. But how does it actually work? What if regularly my users keep updatin...

In PHP, Removing first element in CSV String

I'm simply looking to take the first csv out of a string, using PHP. Here are a few examples: "Sea Bass, Floured Or Breaded, Fried" => "Floured Or Breaded, Fried" "Tuna, Fresh, Baked Or Broiled" => "Fresh, Baked Or Broiled" "Croaker, Breaded Or Battered, Baked" => "Breaded Or Battered, Baked" And so on... Thank you. ...

Help with security doubt (PHP MYSQL APACHE Windows)

Hello, for example i have this url: http://localhost/miSite/uploads/ and by doing: http://localhost/miSite/uploads/../includes/, this results in a directory (includes) linsting. It'd be great if you could tell me a way to resolve this. ...

Invalid argument supplied for foreach!

Hello all. I have the following code: <? foreach($format as $form) { echo $form; ?> <ul> <? $s = $database->onlineFormatUsers($form); while($row=mysql_fetch_assoc($s)) { $username=$row['username']; $id=$row['id'];?> <li><a href="../userprofile.php?id=<?echo...

php echoing <div> in wrong place

i am working on an an options panel for a wordpress theme. this problem has started since i tried trying to add jquery, but it doesn't seem like it should be a jquery problem.. and doesn't go away when i delete all my jquery scripts. anyway PHP determines whether the page was saved, reset, etc and displays an appropriate message at t...

Array not populating correctly

Hi I am using the following code to populate an array: $number = count ($quantitys); $count = "0"; while ($count < $number) { $ref[$count] = postcodeUnknown ($prefix, $postcodes[$count]); $count = $count +1; } postcodeUnknown returns the first row from a mysql query, using a table prefix and an element ...

file_get_Contents won't send query strings in url , thus receiving nothing with $_GET

I'm trying to make a request to a website this way : file_get_contents('http://www.yahoo.com/index.php?var=value'); in the index.php file ( Receiver ) , when I try to echo $_GET['var'] from within the index.php and get the response with file_Get_contents, I get nothing. curl is getting it right , but I just want to know it this way ...

PHP, print_r($_SESSION) doesn't show its content ?

hi, I want to see the content of the the array $_SESSION with the command print_r($_SESSION) but what I get is just the following output: Array () what am I missing ? thanks ...

The jQuery looks great. Now how do I get the PHP email to send?

I am using jQuery to swap out the image here after the submit button on an email from is submitted. This part works very well, however, I also need to generate the email from the form contents. Here is the form: <form action="estimate.php" action="post"> <fieldset> <input type="text" name="na...

INNER JOIN: limit 0,1 on the second table

I have 2 tables, one called "products" and one "images". The table "images" hold the images of each products, so I can have 5 image per product. I want to make a select that retrive only 1 image for each product. I'm new to joins so i dont know how to solve this. I'm trying with: SELECT * FROM products INNER JOIN images ON ...

Designing good PHP quiz script.

hi! I'm developing a quiz module for a school with php and mysql. The requirements are simple: 1) There are 10 categories(subjects). 2) Select 8 random questions from each category and display them one by one. 3) Get the students input. 4) Calculate the result and display it. Now, the problem that i face is how to make the script as...

codeigniter setting up a password!

Hello there! I try to set up a password in a codeigniter form... Everything seems ok to my eyes but no matter which password I use the form is still submitted... here is the code in the controler: class MyBlog extends Controller{ function MyBlog(){ parent::Controller(); $this->load->helper(array('url','form','html'))...

Why doesn't PHP send the email?

I am trying to send an email message with data collected from an html form. Here is the form: <form action="estimate.php" action="post"> <fieldset> <input type="text" name="name" value="FULL NAME" onfocus="if (this.value=='FULL NAME') this.value='';"/> <input type="text" name="phone" value="PHONE NUMBER" onfocus="if...