logo   Home Download Documentation Support

 

DashingDB Documentation

Learn to use DashingDB Within Minutes

 

mysql_show_row Function

mysql_show_row - Show row(s) of MySQL Table.

Syntax

string mysql_show_row ( string table_name, array condition, array split, string is_ascending)

Description

Parameter

Description

table_name

 

Name of the table where data is needed to be inserted.

Input Example: "table_name"

 

 

 

condition

 

Condition that you want to be:

Input Example: $condition["field_name"]["eq"] = "name";

Which means delete rows whose value of field is equal to string name i.e field_name = "name"

Other functions for conditions where eq can be replaced with:

eq - Equivalent to =

neq - Equivalent to !=

gr - Equivalent to >

sm - Equivalent to <

gre - Equivalent to >=

sme - Equivalent to <=

li - Equivalent to LIKE

nli - Equivalent to NOT LIKE

lip - Equivalent to %LIKE%

libp - Equivalent to %LIKE

liap - Equivalent to LIKE%

nlip - Equivalent to NOT %LIKE%

nlibp - Equivalent to NOT%LIKE

nliap - Equivalent to NOT LIKE%

regex - Equivalent to REGEXP

regex - Equivalent to REGEXP

nregex - Equivalent to NOT REGEXP

in - Equivalent to IN

nin - Equivalent to NOT IN


 

 

split

 

"false" to display all result or enter array in following way:

$split["page"] = 4;
$split["rpg"] = 5;

You cannot change the keys name i.e keys here are page and rpg. However you can change the values, page is the page number or you can say current page, while rpg means results per page or rows per page.

Input Example: $split["page"] = 4; $split["rpg"] = 10;

 


is_ascending

 

"true" to display results in ascending order, "false" to display result in descending order.

Input Example: "true" or "false"

To sort cutom field, write like field=true

Input Example: "field=true" or "field=false"


Errors

Error

Description

Error: No table ("table_name") or field ("field_name") exists. Field entered in condition or update_items either does not exist or table_name entered does not exists.

Examples

Example 1

 

<?php

include("class.php");

 

$condition["field_name"]["eq"] = "some_value";

 

$data = mysql_show_row("tablename", $condition, "false", "false");

 

print_r($data); // All results would be shown in descending order

?>

 

Array of Results will be displayed.

 

Example 2

 

<?php

include("class.php");

 

$condition["field_name"]["eq"] = "some_value";

 

$split["page"] = 1; // Means show first page
$split["rpg"] = 5;

 

$data = mysql_show_row("tablename", $condition, $split, "true");

 

print_r($data); // All results would be shown in ascending order

?>

 

Array of Results will be displayed.

Example 3

 

<?php

include("class.php");

 

$condition["field_name"]["eq"] = "some_value";

 

$split["page"] = 1; // Means show first page
$split["rpg"] = 5;

 

$data = mysql_show_row("tablename", $condition, $split, "field_name=true");

 

print_r($data); // All results would be shown in ascending order according to field_name

?>

 

Array of Results will be displayed.

 

 

 

© 2017 DashingDB.