Raised This Month: $ Target: $400
 0% 

Work with Mysql, the request to help to understand


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asdcoolpix
Junior Member
Join Date: Aug 2008
Old 04-07-2009 , 12:10   Work with Mysql, the request to help to understand
Reply With Quote #1

Kind time your help for a spelling of some of mine задумок is necessary To me, but for this purpose it is necessary for me to receive some skills on operation with a database. I hope you will help))

Some primitive tasks which it would be necessary to solve)

development Conditions:

1. Database MySql:
db_name = "testname"
db_user = "testuser"
db_pass = "testpass"
the table test a table design:
[IMG]http://img530.**************/img530/9821/testtable.jpg[/IMG]
2. server with AMXX

The task to write plug-ins for operation with this base:
1. The plug-in which would select from a DB a value x And printed in server console a value
2. The plug-in which would select from a DB a value x and a variable y would bring them in the array, and then output in the console of a server value of variables.
3. The plug-in which would select from a DB a value x and a variable y added two variables and created new string of record in the table with variable = cAnd value value in the form of their sum.
4. The plug-in which would refresh value of new string c. If c = 5 then replace on 0

Well and what a thread a plug-in for record removal in the table in general.






Excuse me for my English I from Russia
asdcoolpix is offline
Send a message via ICQ to asdcoolpix Send a message via Skype™ to asdcoolpix
asdcoolpix
Junior Member
Join Date: Aug 2008
Old 04-07-2009 , 15:13   Re: Work with Mysql, the request to help to understand
Reply With Quote #2

please help me
asdcoolpix is offline
Send a message via ICQ to asdcoolpix Send a message via Skype™ to asdcoolpix
asdcoolpix
Junior Member
Join Date: Aug 2008
Old 04-08-2009 , 08:28   Re: Work with Mysql, the request to help to understand
Reply With Quote #3

up
asdcoolpix is offline
Send a message via ICQ to asdcoolpix Send a message via Skype™ to asdcoolpix
asdcoolpix
Junior Member
Join Date: Aug 2008
Old 04-08-2009 , 16:17   Re: Work with Mysql, the request to help to understand
Reply With Quote #4

up2
asdcoolpix is offline
Send a message via ICQ to asdcoolpix Send a message via Skype™ to asdcoolpix
asdcoolpix
Junior Member
Join Date: Aug 2008
Old 04-09-2009 , 09:23   HELP ME PLEASE !!!!
Reply With Quote #5

I have already started to understand itself. But has faced a problem. I try to output contents of a cell of a database in the console of a server. But anything it is impossible to me here a code part which does not work:

DB

[IMG]http://img4.**************/img4/2429/97666737.jpg[/IMG]

PHP Code:
#define H_TABLE_UP "hmk_update"
#define H_TABLE_UPQ "huds" 
...............
.............
....
PHP Code:
public update(){
    if (
dbc == SQL_FAILED) {
        
server_print("[HOMKA-update] not connect with db")
                            }
    else {
        
server_print("[HOMKA-update] connect with db - OK !");
        
result dbi_query(dbc,"SELECT value FROM `%s` WHERE type = `%s`",H_TABLE_UP,H_TABLE_UPQ);
        new 
pr[32]
        
//SQL_ReadResult(result, 0, pr, 31)
        
dbi_result(result"value"pr31)  //line 96
        
server_print("resultat: %s"pr)
       
    }


It writes a server to the console:
Code:
[HOMKA-update] connect with db - OK !

L 04/09/2009 - 17:35:51: [MySQL] Invalid DBI result handle -1
L 04/09/2009 - 17:35:51: [AMXX] Displaying debug trace (plugin "tak.amxx")
L 04/09/2009 - 17:35:51: [AMXX] Run time error 10: native error (native "dbi_result")
L 04/09/2009 - 17:35:51: [AMXX]    [0] tak.sma::update (line 96)
Help me to output result in the server console

Last edited by asdcoolpix; 04-09-2009 at 09:37.
asdcoolpix is offline
Send a message via ICQ to asdcoolpix Send a message via Skype™ to asdcoolpix
asdcoolpix
Junior Member
Join Date: Aug 2008
Old 04-09-2009 , 11:13   Re: Work with Mysql, the request to help to understand
Reply With Quote #6

please help me
asdcoolpix is offline
Send a message via ICQ to asdcoolpix Send a message via Skype™ to asdcoolpix
DaxProxy
Senior Member
Join Date: Sep 2007
Old 07-12-2009 , 05:29   Re: Work with Mysql, the request to help to understand
Reply With Quote #7

Use sqlX instead of DBI, DBI cant give any output youre asking for.
DaxProxy is offline
Reply



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


All times are GMT -4. The time now is 02:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode