21-03-2005, 16:21
|
|
|
חבר מתאריך: 01.11.04
הודעות: 109
|
|
תודה רבה
תודה רבה! עזרת לי מאוד!
אבל, במחלקה שכתבת איך אני יוצר Query?
ניסתי ככה אבל לא עבד לי:
קוד PHP:
<?php class DataBase{ function connect($user,$password,$db) { mysql_connect("localhost",$user,$password); mysql_select_db($db); } function query($query) { $q = mysql_query($query); return $q; } function row($query) { $a = mysql_fetch_row($query); } function output($msg) { return $msg; } } $DB = new DataBase(); include "config.php"; $DB->connect($cname,$cpassword,$db); $a = $DB->row($DB->query("SELECT * FROM guides")); echo $a["title"]; ?>
ניסתי גם את זה..
קוד PHP:
<?php class DataBase{ function connect($user,$password,$db) { mysql_connect("localhost",$user,$password); mysql_select_db($db); } function row($query) { $a = mysql_fetch_row($query); return $a; } function query($query) { $a = mysql_query($query); return $a; } function output($msg) { return $msg; } } $DB = new DataBase(); include "config.php"; $DB->connect($cname,$cpassword,$db); $query = $DB->query("SELECT * FROM guides WHERE id=2"); $a = $DB->row($query); echo $DB->output($a["text"]); ?>
(לא עובד)
_____________________________________
Your signature did not follow Fresh's signatures policy, therefore it was automatically erased. Please see the E-Mail which has been sent to you, to learn how to fix this.
נערך לאחרונה ע"י Tal_aviel בתאריך 21-03-2005 בשעה 16:43.
|