I know that I have seen a method out there in PHP that when called will give me the current CPU status, but I cannot remember it, and google searches are not coming up with anything for me.
Basically, I have a chat program, and I need to make sure that it doesn't wreak havoc on the server. So I would like to, when a message is posted (...
$query = "select * from a ...";
if($result = mysql_query($query,$con))
{while($row = mysql_fetch_array($result);)
$arr[0][] = $row;
}
$query = "select * from b ...";
if($result = mysql_query($query,$con))
{
while($row = mysql_fetch_array($result);)
$arr[1][] = $row;
}
$query = "select * from c ...";
if($result = mysql_query($query,$...
I'm storing a PHP array where key=>value pairs are information used to build jQuery UI tabs on a website.
The string stored in the MySQL database looks like:
a:2:{i:0;a:2:{i:1;s:9:"Info";i:2;s:643:"<h2><strong>This section is about foo</strong></h2><p><strong>Lorem ipsum ...";}i:1;a:2:{i:1;s:14:"More Info";i:2;s:465:"<p>Lorem ipsum ......
I have the following table:
Comments
--------
id PK
cid
content
uid
comment
If the content is image /i want it to print ?imgID=$cid and get the data from the row title from the table images and if it's a thread I want it to print ?threadID=$cid and get the title from the table threads and so on. How should I do this?
<h3...
Is there a way to change a date from
1985-12-15
to
1985-12
without using a regular Expression?
...
I want to generate a list of the second level of keys used. Each record does not contain all of the same keys. But I need to know what all of the keys are. array_keys() doesn't work, it only returns a list of numbers.
Essentially the output Im looking for is:
action, id, validate, Base, Ebase, Ftype, Qty, Type, Label, Unit
I have a la...
Hi all,i want to ask..Does anyone ever before create a discount system with php for ecommerce. I.e : Before discount,the price was $100,after discount the price become $85,and the $100 was stroked..Thanks..
...
I'm looking at the demo videos at the CodeIgniter site and browsing through the documentation but its is unclear to my how I can achieve dynamic navigation from one page to another, depending on user input.
For example I'd like to have a login form that will either forward to a "success page" or a "login failed page".
Where should I p...
I am using the nusoap lib with a cakephp app for legacy / compatibility reasons, I was just wondering if it was totally necessary to create an instance of nusoap_server, I can't figure out any obvious reason for doing this when i can just output any data formatted as xml nilly willy without creating a server instance - is it perhaps just...
What I mean is that I want logged in members to add their own tags to any given question they see fit. So far, I have got the following script that calls the tags entered into the database which is below.
<?php
function tag_info() {
$result = mysql_query("SELECT * FROM tags GROUP BY tag ORDER BY count DESC");
while($row = mysql_fet...
I'm trying to write a little php to update an svn repo on a server running xampplite under windows. (This is a development server, not a production one.)
Here's my php:
<?php
passthru("update.bat");
// I also tried exec() & putting the svn command in directly
?>
update.bat is sitting in the same folder as the php script
Here's the ...
I work in a dev environment that is currently IIS6/Server 2003 with Framework 3.5. I primarily am working in ASP.NET MVC.
I've run into a scenario where, for the solution I'm working on, I'd either have to spend weeks reinventing the wheel or integrating a PHP-based opensource project into one of the components I'm building.
I'd love ...
Hey, I'm trying to find a gui to parse xdebug trace files. Although you can make them human readable, the sheer number of lines makes it unusable.
I'm looking for something like kcachegrind but for a trace file. My main goal behind all this is to find what the memory hogs are.
Thanks!
...
Can anyone show me or point me to a tutorial that shows me how to upload info like an article to a mysql database using php.
...
I am not sure why this i get this mysql error. Originally i didnt have '' around the date. Then i tried ''' and '`' without any luck. Whats wrong?
SELECT COUNT(user) WHERE user=1 AND pass_time<'2009-09-21 13:44:38';
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right synta...
I'm trying to override the linkAction method so that I can serve up downloadables in S3, etc.
...
I'm trying to write a class that can add a bookmark to my Delicious account.
Here's my method:
public function addBookmark($url, $description) {
$dusername = 'myUsername';
$dpassword = 'myPassword';
$api = 'api.del.icio.us/v1';
$link = urlencode($url);
$desc = urlencode($description);
$apicall = "https://$dusername:$d...
I was wondering if some one enters a word into a database from a php form how can you count how many people have entered that same word in the database as well as how not to create a whole unique id for that same word just a count for that same word when the user enters the same word.
...
Basically, I want to display local events to people on a page. So if you were from California you would have different things than someone from Florida. I am going to be using php for the rest of the project so php is a must.
I would prefer to get the data without having to ask the user for additional information. IF I have to ask fo...
I just set up a database according to CakePHP's conventions, ran the "bake" scripts for models, controllers and views, and made sure the path was set up correctly.
When I go to the following style of URL:
http://BASEURL/app/controller_name
I get the expected list view for that controller, but all the links generated by baked pages ar...