I have the following code:
function dbInsert()
{
global $dbcon, $dbtable;
global $inputData;
$sqlQuery = 'INSERT INTO ' . $dbtable . ' (id_author, date, title, description) VALUES (?, ?, ?, ?)';
$stmt = $dbcon->prepare($sqlQuery);
echo $sqlQuery;
$stmt->bind_param('isss', $inputData['idAuthor'], $inputData['date...
I currently use FPDF to create some fairly complicated reports and am trying to upgrade to TCPDF, but I've found that my same code running through TCPDF is about twice as slow. Because my PDFs already take up to a minute to generate I can't really afford to have this slowdown, but I'd really like to take advantage of some TCPDF features ...
Does anyone know how can I get the last digit number from the Ip address in php?
example:
$ip = '200.0.0.12';
How can I get only 12 from the IP address instead of 200.0.0.12?
...
Possible Duplicate:
What are the benefits of OO programming? Will it help me write better code?
OO PHP Explanation for a braindead n00b
Just started learning/playing with creating classes in PHP and I'm wondering what pain do they solve? It seems like I can get the same job done with just a collection of functions that I inclu...
Hi
I have a bunch of ID's.
I can assign them once a day.
I need to query my database, see if they're any ID's available to hand out (if I didn't hand out all of them in a 24 hour period), and if there's any available, write a new row to the database saying that the ID has been handed out. I also need to know which user held which ID at...
Ok, So I am trying to query my database and select all rows that have a certain value.
After that I turn the query into an array with mysql_fetch_array(), then I tried iterating by row through the fetched array using a for each loop.
<?php
$query = mysql_query("SELECT * FROM users WHERE pointsAvailable > 0 ORDER BY pointsAvailable Desc"...
Hi All,
I'm just becoming dive into php after ages working in vb.net.
I wanna write a logger class that runs as singleon over my webapp, here the code:
class cLog{
private $data = NULL;
static private $instance = NULL;
static public function getInstance(){
if(self::$instance == NULL){
echo "empty!";
self::$inst...
Where can I find code for a word document parser preferably in PHP or any other language
...
What I'm trying to do is very simple, but I'm looking to do it most efficiently, preferably using php builtin fns.
$str = '1234';
echo replace_function(array('1','3'),array('3','1'),$str);
// output: 3214
str_replace,preg_replace would result in 1214, which means it goes through the arrays, replacing matched strings. I'm looking for ...
Recently programming in PHP, I thought I had a working Perl regular expression but when I checked it against what I wanted, it didn't work.
What is the right expression to check if something is a MD5 has (32 digit hexadecimal of a-z and 0-9).
Currently, I have /^[a-z0-9]{32}$/i
...
I'm trying to use facebook connect in my site so users can register/login with it and I'm having a little bit of trouble understanding all the tutorials around the web.
My question is simple, does the facebook php client lib work in my use case or only to develop facebook applications that run inside fb ?
...
What in the heck do you put as the host for Memcache::addServer($host, $port)?
I am hosting on mediatemple and this is really, really, really, really starting to get to me.
Do I have to set up a new memcahce server or what. I have no idea what to do and every tut just keeps saying "localhost". Well I don't want to run it on my localhos...
i've got an column named 'id' in a mysql table which also is a primary key that auto-increments.
when i delete rows their id's will also be deleted thus creating "holes" in my id sequence, eg.
1, 2, 3, 9, 10, 30 and so on
is there a way of reusing these deleted id:s?
...
hi, I have two arrays that need to be merged together and trying to figure out the correct way of doing it.
this is the first array
Array
(
[IndividualOutmsg] => Array
(
[0] => Array
(
[user_id] => 3
[number] => 414566765
...
Hi,
In our cakephp application, we do a
file_get_contents('http://my.web.com',... );
Recently we changed the ip address of my.web.com, and we modified our /etc/hosts file, and flush dns cache using /etc/init.d/nscd restart, and restarted apache.
However, file_get_contents still refer to the old ip address,
while if we do ping, nsl...
Trying to create a simple 2 table database that lists the contents of various firewire drives, one table with FW number, the other with a file item on that drive number.
eg. fw 233
file -> mike's home movie.mov
I'm very new and can create single tables with queries, but haven't understood querying multiple tables with join.
each d...
We try to create a bucket on Amazon S3............. what's wrong with this code????????????
$req =& new HTTP_Request("http://s3.amazonaws.com/[bucket-name]");
$req->setMethod("PUT");
setAuthorizationHeader($req);
$req->sendRequest();
if ($req->getResponseCode() == 200)
{
// bucket was created
}
else
{
// someth...
[Status: learner]
Using checkboxes, the user selects rows from a displayed HTML table. I then want to insert the date and the unique row id ("select_id") of the selected ('ticked') rows into a different table. Maybe I'm off-base, but it seems to me that the first block of code does not work. The second block of code does work. If I'...
I want to get the location of people logging into my website and I think it is called Whois.
So how would I go about locating people in PHP?
...
I noticed that ffdb in PHP are awfully slow. So how would I go about speeding up the ffdb without SQL?
...