Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 9th August 2012, 02:06 AM
Jeff Sadowski Offline
Registered User
 
Join Date: Jun 2005
Age: 38
Posts: 350
linuxubuntufirefox
php parameterized queries

I'd like to use parameterized queries but it seems tricky. When I installed it on windows i could use mysqli::get_results.
Code:
<?php
$mysqli = new mysqli("localhost", "username", "password", "database");
function run_sql($sql,$parameters=null)
{global $mysqli,$mysqli_results;
$stmt = $mysqli->prepare($sql);
 if($parameters!=null)
 {call_user_func_array(array($stmt,'bind_param'),$parameters);
 }
 $stmt->execute();
 $mysqli_results=$stmt->get_result();
}
function fetch_array()
{global $mysqli_results;
 return mysqli_fetch_array($mysqli_results);
}
?>
When I try the above functions I get "Call to undefined method mysqli_stmt::get_result"
Are there other less mysql specific functions I can use to use parameterized sql statements?

Last edited by Jeff Sadowski; 9th August 2012 at 02:09 AM.
Reply With Quote
  #2  
Old 9th August 2012, 11:01 AM
glway Offline
Registered User
 
Join Date: Sep 2011
Posts: 44
windows_xp_2003firefox
Re: php parameterized queries

open a terminal:
Code:
sudo yum install php-pear-MDB2-Driver-mysql
that should take care of it

Last edited by glway; 9th August 2012 at 11:15 AM.
Reply With Quote
Reply

Tags
parameterized, php, queries

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DNS queries? Kholdstate Servers & Networking 3 31st August 2011 01:30 AM
FC2 upgrade queries WATSON EOL (End Of Life) Versions 1 25th May 2004 03:05 PM


Current GMT-time: 05:24 (Thursday, 20-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat