/    Sign up×
Community /Pin to ProfileBookmark

Convert ip 66.249.75.215 to 0x249f94bd7 via $pdo->prepare

How do I update a table and convert say, 66.249.75.215, from one column to another column as 0x249f94bd7. Both columns are varbinary. I’m using PDOConnect and this isn’t working:

$stmt = $pdo->prepare(“UPDATE `download` SET `ip_address` = (?) WHERE ip_address is null”);
$stmt->execute(inet_aton(`ADDRESS`)) ;

I’m getting the following error:

Fatal error: Uncaught Error: Call to undefined function inet6_aton() in /home/larry/web/test/public_html/index.php:31 Stack trace: #0 {main} thrown in /home/larry/web/test/public_html/index.php on line 31

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @larry29936 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...