- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
class mysql_act extends main {
function mysql_count($zap, $m) {
$q = mysql_query($zap);
if ($m == 'count') {
$qc = mysql_num_rows($zap);
} else
$qc = mysql_fetch_array($q);
return $qc;
}
function mysql_method($method ,$arr, $db, $wh) {
$i = 0;
foreach ($arr as $k => $v) {
$i++;
if (count($arr)==$i)
$par .= '`'. $k .'`=\''.$v.'\'';
else
$par .= '`'. $k .'`=\''.$v.'\' &&';
}
$n=0;
foreach ($wh as $k => $v) {
$n++;
if (count($arr)==$n)
$parw .= '`'. $k .'`=\''.$v.'\'';
else
$parw .= '`'. $k .'`=\''.$v.'\' &&';
}
switch ($method) {
case 'SELECT':
$req = 'SELECT * FROM '. $db .' WHERE '. $par;
break;
case 'UPDATE':
$req = 'UPDATE '.$db.' SET '.$parw.' WHERE '. $par;
}
$q['req'] = mysql_query($req);
$q['arr'] = mysql_fetch_array($q['req']);
return $q;
}
rO_ot 07.05.2011 21:59 # 0
istem 07.05.2011 22:48 # +2
Jetti 07.05.2011 23:35 # 0
Vasiliy 08.05.2011 10:04 # +2
guest8 08.04.2019 20:43 # −999
guest8 08.04.2019 21:04 # −999
guest8 08.04.2019 22:07 # −999
guest8 09.04.2019 10:42 # −999
guest8 09.04.2019 17:49 # −999