473,407 Members | 2,546 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,407 software developers and data experts.

db_query is it part of PHP or MySQL or user-written

I once did a course on PHP and I'm now trying to get back into the
language.

I'm looking at some of the SMF scripts and am getting stuck very early
on in figuring out things.

In the code, I see (for instance):

$request = db_query("
SELECT passwd, ID_MEMBER, ID_GROUP, lngfile, is_activated,
emailAddress, additionalGroups, memberName, passwordSalt
FROM {$db_prefix}members
WHERE memberName = '$_REQUEST[user]'
LIMIT 1", __FILE__, __LINE__);

What I can't figure out (after having searched both the php.net site
and the MySQL site if the
db_query is a user-written function or part of the built-in MySQL
functions?

I've looked in the code and couldn't find where such a function might
be defined. If it is not in the actual module I'm looking at, it must
be included with an include or some other method?

I strongly suspect that the db_query function is specific to the SMF
scripts, since it is passing the file name and line number so I
suspect that the db-query function can issue a good diagnostic message
with traceback to the calling code. But I can't figure out where they
have hidden the function.
Nov 10 '08 #1
3 2866
On Mon, 10 Nov 2008 14:29:28 -0800 (PST), MP*****@gmail.com wrote:
I once did a course on PHP and I'm now trying to get back into the
language.

I'm looking at some of the SMF scripts and am getting stuck very early
on in figuring out things.

In the code, I see (for instance):

$request = db_query("
SELECT passwd, ID_MEMBER, ID_GROUP, lngfile, is_activated,
emailAddress, additionalGroups, memberName, passwordSalt
FROM {$db_prefix}members
WHERE memberName = '$_REQUEST[user]'
LIMIT 1", __FILE__, __LINE__);

What I can't figure out (after having searched both the php.net site
and the MySQL site if the
db_query is a user-written function or part of the built-in MySQL
functions?

I've looked in the code and couldn't find where such a function might
be defined. If it is not in the actual module I'm looking at, it must
be included with an include or some other method?

I strongly suspect that the db_query function is specific to the SMF
scripts, since it is passing the file name and line number so I
suspect that the db-query function can issue a good diagnostic message
with traceback to the calling code. But I can't figure out where they
have hidden the function.
You'd probably get more/better answers about SMF when asking in the
SMF community. As Michael Vilain pointed out, db_query() is not
defined in the MySQL API. If you want to find where it is defined
within the SMF source code, either search SMF documentation, or
possibly resort to grep'ing on the command line for "function
db_query(" or something to that effect.

A quick PHP manual shortcut to keep in mind: you can easily search
PHP's docs for any function by using:

http://php.net/function_name_or_feature

where function_name_or_feature is whatever you intend to look up.
The result is, more often than not, what's most relevant, and the
thing for which you're looking.
--
Curtis
$email = str_replace('sig.invalid', 'gmail.com', $from);
Nov 11 '08 #2
MikeB escribió:
$request = db_query("
SELECT passwd, ID_MEMBER, ID_GROUP, lngfile, is_activated,
emailAddress, additionalGroups, memberName, passwordSalt
FROM {$db_prefix}members
WHERE memberName = '$_REQUEST[user]'
LIMIT 1", __FILE__, __LINE__);

What I can't figure out (after having searched both the php.net site
and the MySQL site if the
db_query is a user-written function or part of the built-in MySQL
functions?
You forgot to search within SMF itself ;-)

Buscando: function db_query
Sources\Subs.php(238): function db_query($db_string, $file, $line)
1 caso(s) encontrado(s) en 1 archivo(s)
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
Nov 11 '08 #3
In the code, I see (for instance):

$request = db_query("
SELECT passwd, ID_MEMBER, ID_GROUP, lngfile, is_activated,
emailAddress, additionalGroups, memberName, passwordSalt
FROM {$db_prefix}members
WHERE memberName = '$_REQUEST[user]'
LIMIT 1", __FILE__, __LINE__);
I'd say user written or framework. PHP usually includes the DB
engine name in their database commands.
Nov 12 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lefevre, Steven | last post by:
Hey folks - Thanks to everyone who gave input to my concerns. Of course, we don't intend to have the mysql port open to the world. We will have Apache/PHP connect on a unix socket, or to another...
0
by: Mark Adams | last post by:
I am a relative newbie to MySQL. I had a Postfix+Courier+MySQL mail server running for several months. It took me a week or so to get it up and running in September. Now, I did a clean upgrade to...
0
by: Mark Adams | last post by:
I really need some help with this. MySQL will not start on boot despite everything I've done to make sure that it is set to do so. When I start it as root from a terminal with...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
4
by: Adam Smith | last post by:
I have a dedicated server running 'FreeBSD 4.9 STABLE' at a hosting site. They have done some default installations, presumably from the CVS ports package ??. Herein lies the problem, "I do not...
0
by: ./Rob & | last post by:
Hi gang: I'm experiencing a problem with MySQL -- I updated MySQL from version 4.1.0 to 4.1.10 and now when I login as root it doesn't show all the databases I should have access to, nor it...
5
by: MLH | last post by:
I'm supposed to set a password for the MySQL root user. The output of mysql_install_db instructed me to run the following commands... /usr/bin/mysqladmin -u root -h appserver password mynwewpasswd...
3
by: Google Mike | last post by:
On Linux, I need to ask what your favorite installation options are for a PHP app as a kind of poll. In this first part, I discuss the Install Wizard choices. In Part 2, I discuss the database...
8
by: sundeep.kumara | last post by:
hi all, I am a newbie .....I have compiled the source code of mysql-4.1.9 on PPC-Linux Its not giving any errors during configure,make or make install. But,when i try to start the server...
0
by: taras.di | last post by:
I'm trying to understand why MySQL isn't using all parts of the primary key when I add in an OR statement in the query. I have a people database, and a distances database. The people database...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
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,...

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.