Jump to content
xisto Community
Sign in to follow this  
nerdy monkey

Sql Query How do i run an SQL query

Recommended Posts

hi,I did not exactly understand what u mean by executing sql query for phpbb mods.From what I understand is u have a script which needs to be executed for the phpbb mod to work.To do this login to cpanel and go to phpMyadmin. Select the database on which u want to execute the query.Select the SQL tab. Type in or upload the file with the sql statements and click go.All the sql statements in the file will execute one after the other.For executing the query thru phpgo to the cpanel and select mysql databases.For the database that u require, there will be connection string available for perl,php and jdbc. U can use the php connection string for getting a connection in php and executing the sql query.Cheers.

Share this post


Link to post
Share on other sites

I have been attempting to add mods to PHPbb forums for a while now but i have been unable to because i have no idea how to run a Mysql or SQL Query. if anyone could let me know how i would greatly appreciate it.

177395[/snapback]


To run an SQL query, first you have to connect to your server thusly :

mysql_pconnect ( $ServerAddress, $mySQL_Username, $mySQL_Password );

Then you have to select a database, like so.

mysql_selectdb ( $DataBaseName );

Then you run a query like this :

mysql_query ($querystring );

Hope that helps.

Share this post


Link to post
Share on other sites

To run an SQL query, first you have to connect to your server thusly :

mysql_pconnect ( $ServerAddress, $mySQL_Username, $mySQL_Password );

Then you have to select a database, like so.
mysql_selectdb ( $DataBaseName );

Then you run a query like this :
mysql_query ($querystring );

Hope that helps.
I don't think that's the case. PHPBB use a database layer to communicate with the database instead of using the database directly. So it is compatible with multiple Database so I think you should use the Database layer. I don't remember but you can study code in the PHPBB directory

Share this post


Link to post
Share on other sites

I was just looking through the phpBB code, and, indeed, it does have a database abstraction layer. That's because phpBB doesn't know where it will be running - except that it will be on some PHP machine, with some database it can talk to using SQL. However, since we - the end-user - know that it will be running on mySQL, we don't need to use abstraction because we know that we're only writing the hack to run in one place. Of course, if you do move to a non-mySQL database, you're royally shafted.Oh, and i screwed up : it's mysql_select_db().

Share this post


Link to post
Share on other sites

picke the of is Mambo solutions for Website Mambo solutions (PHP and MySQL) !when work web site, you can update files and more plenty ...Update files : :( - Mambo modules- Mambo componentes- Mambo mambotshappily :(:P:P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.