Hello!
I would like to ask your help, i have founded a great code here: http://www.jamescaws.c o.uk/2008/07/dynamically-count-exit-link-clicks-throughs-using-javascript-php/
but it uses Pear DB for the database connection. the problem is that it don't works, actually the php don't writes anything in the table and i don't get any error when i add the - if (PEAR::isError($db)) {
-
die($db->getMessage());}
code, so not the connection...
Then i tried a simple insert (a Pear DB one, from the pear manual... )
it looks like this: - $res =& $db->query("INSERT INTO ct_Links (hash, url) VALUES (v, something)");
there's no succes so, maybe somebody can help to rewrite the code to use only simple mysql and php without the pear package... please:D
the connect is simple. but there are some code i don't really no how to transform: - $db->setFetchMode(DB_FETCHMODE_ASSOC);
-
-
function local_getLinkID($db, $debugObj, $sHash) {
-
$sql = sprintf('SELECT linkID FROM ct_Links WHERE hash = %s', $db->quoteSmart($sHash));
-
-
$debugObj->output("local_getLinkID($db, $debugObj, $sHash) : $sql");
-
-
$iID = $db->getOne($sql);
-
-
function local_logNewLink($db, $debugObj, $sHash, $sURL) {
-
$sql = sprintf('INSERT INTO ct_Links (hash, url) VALUES (%s, %s)',
-
$db->quoteSmart($sHash),
-
$db->quoteSmart($sURL)
-
);
-
-
$debugObj->output("local_logNewLink($db, $debugObj, $sHash, $sURL) : $sql");
-
-
$db->query($sql);
-
-
return $db->getOne('SELECT LAST_INSERT_ID()');
-
}
-
-
-
function local_logLinkClick($db, $debugObj, $iLinkID, $sIP, $sUserAgent) {
-
$sql = sprintf('INSERT INTO ct_Log (linkID, ip, useragent) VALUES (%d, INET_ATON(%s), %s)',
-
$iLinkID,
-
$db->quoteSmart($sIP),
-
$db->quoteSmart($sUserAgent)
-
);
-
-
$debugObj->output("local_logLinkClick($db, $debugObj, $iLinkID, $sIP, $sUserAgent) : $sql");
-
-
$db->query($sql);
thanks for any help!!
2 2069 Atli 5,058
Recognized Expert Expert
Hi.
You shouldn't have any trouble changing your code to use the MySQLI extension.
Any decent host should support it.
There are excellent examples of how to use it in the mysqli_query section of the manual.
ok thank you very much i will try
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Ian.H |
last post by:
Hi all,
I've taken on a massive project for a client recently and now I've hit
some bug fixes that are required (3rd party code). and was just wondering
about peoples opinions / personal findings.
This set of scripts for the section of the project use an ADODB class for
MySQL. I've never used this method before (I wrote a class a while back to
handle my MySQL core code which was mainly a wrapper for various mysql_*()
functions etc)....
|
by: madcap |
last post by:
Hi,
Our company was looking for contract programmer to develop an
internet/intranet application. We were approached by a freelancer who
have quite a lot experience and his resume was impressive. But he did
mention that if we download php & mysql and use the application
developed within our company, we should be fine and there will not be
any legal issues. While some of the folks see this as a low cost
solution, others are concerned...
|
by: James |
last post by:
Hey everyone, I have a really obscure but impassable problem with a
reasonably simple piece of php/PEAR DB/MySQL code
When calling several stored procs the first call succeeds, but
subsequent calls fail no matter which SP is called first it always
works, and the rest fail... with:
>>>
|
by: Bill Bevis |
last post by:
I'm trying to set up PHP 5.1.3 to run under Apache2, and talk to a
MySQL 5.0.21 database, and have been banging my head against a tough
install for days. I'm getting a slough of errors like this:
/usr/local/ssl/lib/libssl.a(ssl_sess.o)(.text+0xe60): In function
`SSL_SESSION_set_timeout':
: multiple definition of `SSL_SESSION_set_timeout'
/home/software/mysql-standard-5.0.21-linux-i686/lib/libmysqlclient.a(ssl.o)(.text+0x6d8):
first...
|
by: Paul |
last post by:
I recently upgraded from MySQL 3.23 to 4.1. Now db is not working properly.
I'd very much like your help in solving this issue!
Here's the code I used to test it:
require_once 'DB.php';
$db =&
DB::connect('mysql://user:password@localhost/dbname');
if (PEAR::isError($db)) {
die($db->getMessage());
| |
by: eholz1 |
last post by:
Hello Newsgroup,
I have redhat 3.0 Enterprise, and mysql (3.58.xxx more or less)
installed from a redhat rpm,
and php 4.3.9 (installed from an rpm) - I can access data from my mysql
db using php and the "pear" Db .php. I recently upgraded my Apache to
2.2 and installed (more or less) PHP 5.2 as well - neither of these
installs were from a Redhat rpm, I downloaded the tarballs, extracted,
configed, make, etc.
Apache seems to work fine...
|
by: john |
last post by:
All:
Very experienced developer, newbie to PHP. My situation:
I have installed on my WIndows XP machine the following:
* PHP 5.2.1
* MySQL 5.0
* Apache 2.2
All of these are installed under C:\Program Files under their own
|
by: jmark |
last post by:
I need some assistance on how to create a select statement using PEAR
DB or MySQL with the LIKE function.
That is I am looking of how I can get statement like this work.
SELECT * FROM customer WHERE name LIKE '%?'
|
by: Abhinay |
last post by:
Hi there,
I am C++ programer, new in MySql database, I am using linux OS.
Is MySql supports pear to pear replication ( I wanted to duplicate data of master database to salve database at run time for each and every transaction ) ? If no then how to achive it ?
I know SqlServer provides pear to pear replication and I wanted to know about similar facility in MySql database.
your help would make me happy.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |