fetch object

Questionsfetch object
german asked 10 years ago

How to use mysql_fetch_assoc(mysql_query($check_sql))

to fetch data from the db2 database

3 Answers
Abu Ghufran answered 10 years ago

You can call,

$result = $g->execute_query($sql);
$arr = $result->GetRows();

It uses adodb for php and $result is recordset object. Refer documentation of adodb for more help.
http://phplens.com/lens/adodb/docs-adodb.htm

pierre mata answered 9 years ago

Hello, this code i pick from one of your examples, but not work to me, i think is cause you use mysql_query instead mysqli_query, can you show me how is with mysqli_query mode. thanks

$check_sql = "SELECT count(*) as c from clients where LOWER(`name`) = '".strtolower($data["params"]["name"])."'";

$rs = mysql_fetch_assoc(mysql_query($check_sql));

Abu Ghufran answered 9 years ago

If using latest build, you can use this code:
http://www.phpgrid.org/demo/demos/editing/server-validation.phps

Otherwise, you can use above inside callback function, where $g is new jqgrid()

global $g;
$result = $g->execute_query($check_sql );
$rs = $result->GetRows();

Your Answer

17 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?