Parsing HTML in PHP is generally a bad idea. As garbage collection in
PHP is a joke, I would use a better suited tool.
I wrote a simple Java app using the Jsoup HTML parsling library, then
wrote the parsed data to a flat file as JSON. Having a flat it's easy
to read and import in Cake. It's of
It's probably a bad idea to implement this i cake.
It's possible to get a list of databases running on a specific MySQL
instance by issuing
SHOW DATABASES (can also be SHOW DATABASES LIKE %, see the MySQL docs).
Can also be used in $model-query(), this yielded an array like this:
Array
(
You could use a db trigger. Assuming you are using MySQL:
http://en.wikipedia.org/wiki/Database_trigger#Triggers_in_MySQL
you should be able to extend the example to convert NULL to 0.
//mathias
2009/5/9 WebbedIT p...@webbedit.co.uk:
The above is the result of a debug($this-data) after
Hi,
$parsed_xml should be an array representation of the XML. If nothing
is returned (you could also try print_r($parsed_xml) or
var_dump($parsed_xml) ) then your XML is probably malformed or not
loaded.
Try making a simple test like this and show us the output:
$tstxml = testxml test2Content
PHP has several XML functions/classes built in, as well as several
third-party classes.
You could use xpath to loop the data and save.
http://php.net/manual/en/function.simplexml-element-xpath.php
There are also some third-party classes that returns an array. This is
probably easier to work
Try specify the url directly:
url = /comments/add
You should also specify what model you are submitting to:
model = Comment
//mathias
2009/2/19 yankeyhotel m...@groupswitch.com:
has anyone figured out this problem. I am also reading through Apress
Beginning CakePHP and having the same
My two cents:
If your primary goal is to have a FAST webpage serving images and
multimedia content, you build static HTML with maybe some PHP using
lighttpd.
If you are building a social network/heavy interaction app (think
friendfeed/facebook) you either build the framework yourself or spend
I guess you mean your main table:
Inefficient method:
In your controller:
$total_num_rows = count($this-Model-find('all'));
More efficient method, also works if you would like to do it on several tables.
$num = $this-query(SELECT COUNT(*) FROM table_a, table_b);
/mathias
2008/12/31 mona
What state is your app in? Have you tried this-model-id?
2008/12/20, Ken k...@ameliecompany.com:
This is the worst kind of noob question, but I'm stumped. I've tried:
$this-Modelname-getID();
$this-Modelname-getLastInsertID();
$this-data['Modelname']['id'];
a special method from the
I use this, after installing the magic extension on my system (OSX):
$finfo = new finfo(FILEINFO_MIME, /usr/local/share/file/magic.mgc);
$filetype = $finfo-buffer($message['attachment'][0]['filedata']) . \n;
To find magic.mgc on your system, use
locate magic.mgc
or
find / | grep magic.mgc.
I use FPDF and do the processing in the controller, and then pass the
data to the view and echo it there.
pdf_controller() {
// generate PDF
$pdfout = $pdf-output();
$this-set(pdfout, $pdfout);
$this-render(pdf_controller, pdf);
}
and pdf_controller.ctp
?php echo $pdfout; ?
//
I do save
11 matches
Mail list logo