Server Validation

QuestionsServer Validation
Azhar asked 12 months ago

Hello Abu,

This code is not working for me, is there anything problem with this:

function add_client($data)
{
$check_sql = “SELECT count(*) as c from clients where statusid = 4”;

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

if ($rs[“c”] > 0)
phpgrid_error(“Status already exist in database”);

mysql_query(“INSERT INTO clients VALUES (null,'{$data[“params”][“name”]}’,'{$data[“params”][“gender”]}’,'{$data[“params”][“company”]}’)”);
}

1 Answers
Abu Ghufran Staff answered 12 months ago

Hello,

mysql_* funtions are deprecated in php 5.5+

You should replace it with mysqli functions by referring php docs. Or
Use datagrid db layer functions to call database.

https://www.phpgrid.org/demo//demos/editing/custom-events.phps

http://www.phpgrid.org/docs/grid-events/

Events are supported in full version.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

0 + 14 =

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?