473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

call 3rd party extensions func from PHP extension

Hi, im wondering is there a way to call 3rd party extension function from my own PHP extension? like make an MySQL query.

for now i only can imagine a "proxy" method with zend_eval_string() which isnt that good i guess, i also know that i can access standard php function mostly by prefixing them with "php_" like "php_printf", is there way to call mysql function same way? (and if so, how can i know their internal names and signatures?)
tnx ^)
Oct 3 '12 #1
5 1816
You have confused me, Sir. Could your please clarify, post some code, draw a diagram, something to help me understand?

Anyone else understand what he's trying to do?
Oct 3 '12 #2
im new to PHP extension development, and while there are few good tutorials i cant find an example for may particular situation.
this is sort of what i can do in PHP

Expand|Select|Wrap|Line Numbers
  1. $link = mysql_connect(...);
  2. mysql_select_db(...);
  3. $result = mysql_query(...);
  4. $line = mysql_fetch_array($result, MYSQL_ASSOC);
is there way to call mysql_connect/mysql_select_db/... etc from within my extension? same way as i can call php_printf() as of now i can only think of using zend_eval_string() and pass PHP code to it. hope this makes it more clear ^)
Oct 3 '12 #3
Those are built-in functions. You should have no problem using them as-is in your own application.

Are you aware of http://www.php.net/docs.php ? You can read about all the internal functions like the mysql functions on their site.

Just let us know if you need any additional help!
Oct 3 '12 #4
tnx for quick answer, i cant test it right away, but didn't those are userspace (PHP space) functions? please see this question http://bytes.com/topic/php/answers/8...-php-extension as related, differnece in my case that mysql_connect is not one of the core function but part of mysql.so extension.

edited - guess im saved
http://lxr.php.net/xref/PHP_5_4/ext/pdo_mysql/
:) all headers here
Oct 3 '12 #5
in case anyone will find this thread this is the answer
http://lxr.php.net/
search here for PHP space function and then look into souces to see internal function name
in my case
Expand|Select|Wrap|Line Numbers
  1. PHP_FUNCTION(mysql_connect)
  2. {
  3.     php_mysql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
  4. }
Oct 3 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Ever Olano | last post by:
Hi. I have the following questions regarding writing a PHP extension. You don't have to answer all questions. Please answer everything you can. I'd really appreciate it. 1. What is the most...
3
by: Ever Olano | last post by:
I failed to include this in my initial post. I apologize. Can a PHP extension call/use another PHP extension? If so, someone please point me to the right docs/sites or if it's short enough to...
3
by: Ever Olano | last post by:
Hi, there. If you were to install a PHP extension on Windows, in what form would you want the installation to be? Would you want a graphical installer such as InstallShield or MS Windows...
2
by: Letbetter, Jason | last post by:
I'm creating Python extensions for several c/c++ components. I'm using swig to create the extensions. The biggest challenge so far is working with the c args between Python and the Python...
30
by: Jive | last post by:
Can someone explain to me why Python 2.4 on MS Windows has these backward compatibility problems? What am I missing? Why won't extensions compiled to run with 2.3 also work with 2.4? Why does it...
3
by: Johnny | last post by:
Hi, I wonder what is the difference between the built-in function getattr() and the normal call of a function of a class. Here is the details: getattr( object, name) Return the value of...
1
by: Todd | last post by:
Hi, I'm working right from the example here to make a basic extenstion module. http://docs.python.org/ext/intro.html...
6
by: Pieter | last post by:
Hi, I'm trying to use the Edanmo Shell Extension Library (http://www.mvps.org/emorcillo/en/code/shell/shellextensions.shtml) to make a Context Menu in the Windows Explorer with VB.NET 2005. It...
0
by: dmitrey | last post by:
hi all, which way is the simplest for now to obtain the memory amount eaten by call to Python 'myfunc' function? Thx, D
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.