| | 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. |
|
|
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 php go 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. QUOTE(nerdy monkey @ Aug 23 2005, 04:26 AM) 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. To run an SQL query, first you have to connect to your server thusly : CODE mysql_pconnect ( $ServerAddress, $mySQL_Username, $mySQL_Password ); Then you have to select a database, like so. CODE mysql_selectdb ( $DataBaseName ); Then you run a query like this : CODE mysql_query ($querystring ); Hope that helps.
QUOTE(littleweseth) To run an SQL query, first you have to connect to your server thusly : CODE mysql_pconnect ( $ServerAddress, $mySQL_Username, $mySQL_Password ); Then you have to select a database, like so. CODE mysql_selectdb ( $DataBaseName ); Then you run a query like this : CODE 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
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().
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 mambots happily
Similar Topics
Keywords : sql query sql query
theres a bug somewhere in this query and i can't seem to find it. does anyone else see it? hi everyone, CODE function sql() { $fp = Im having trouble getting my PHP to work. Basically i have a form with a button linking to a php I know this isn't the SQL forum but MySQL is used in PHP. I get an error Query: SELECT Looking for sql, query, run, sql, query
|
|
![]() Sql Query - How do i run an SQL query |
| ADD REPLY / Got an Opinion! | a humble request :-) | RAPID SEARCH! | Free Hosting | [X] |
|
Express your Opinions, Thoughts or Contribute your information that might help someone here. Ask your Doubts & Queries to get answers.. "Together, We enlight each other!" |
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP. | 500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE |
|