| |||||||
| المدوّنات | البحث | مشاركات اليوم | اجعل كافة المشاركات مقروءة |
|
| | LinkBack | أدوات الموضوع |
| |||||
| لو ممكن طريقة جمع الاستعلام اخواني انا لدي قاعدة بيانات كود: CREATE TABLE `test` ( `id` int(4) NOT NULL auto_increment, `name` varchar(65) NOT NULL default '', `lastname` varchar(65) NOT NULL default '', `email` varchar(65) NOT NULL default '', PRIMARY KEY (`id`) ) TYPE=MyISAM AUTO_INCREMENT=7 ; -- -- Dumping data for table `test` -- INSERT INTO `test_mysql` VALUES (1, 'Billly', 'Blueton', 'bb5@phpeasystep.com'); INSERT INTO `test_mysql` VALUES (2, 'Jame', 'Campbell', 'jame@somewhere.com'); INSERT INTO `test_mysql` VALUES (3, 'Mark', 'Jackson', 'mark@phpeasystep.com'); INSERT INTO `test_mysql` VALUES (4, 'Linda', 'Travor', 'lin65@phpeasystep.com'); INSERT INTO `test_mysql` VALUES (5, 'Joey', 'Ford', 'fordloi@somewhere.com'); INSERT INTO `test_mysql` VALUES (6, 'Sidney', 'Gibson', 'gibson@phpeasystep.com'); كود: <html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>Add Employee</title>
<style type="text/css"/>
body {
font-family : tahoma;
}
</style>
</head>
<body>
<?php
include("config.php");
$tbl_name="test_mysql"; // Table name
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
?>
<div align="center">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="27%" height="20" id="table1">
<tr>
<div align="center">
<div align="center">
<table width="393" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<div align="center">
<table width="393" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<div align="center">
<table width="393" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<div align="center">
<table border="1" cellspacing="0" cellpadding="5" style="border-style: solid; border-width: 1px" bgcolor="#FFFFFF" width="468">
<tr>
<td align="center" width="227" >
<font color="#000000"><strong>Name</strong></font></td>
<td align="center" width="78" >
<font color="#000000"><strong>lastname</strong></font></td>
<td align="center" width="125" >
<font color="#000000"><strong>Email</strong></font></td>
</tr>
<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td width="227" align="center" bordercolorlight="#FFFFFF" ><b><?php echo $rows['name']; ?></b></td>
<td width="78" align="center" bordercolorlight="#FFFFFF" ><b><?php echo $rows['lastname']; ?></b></td>
<td width="125" align="center" bordercolorlight="#FFFFFF" ><b><?php echo $rows['email']; ?></b></td>
</tr>
<?php
}
?>
</table>
</div>
</td>
</tr>
</table>
</div>
<?php
mysql_close();
?>
</body>
</html> مثلا عندي 6 اسما مدخلة في القاعدة وهي Billly Jame Mark Linda Joey Sidney اريد ان يكون في نهاية الجدول يظهر لي الرقم 6 لان البيانات التي ظهرت 6 صفوف الناتجة عن الاستعلام | |||||
|
| |||||
|
اخوي لقد اضفت الدالة ولكن لا يظهر شي الكود كود: <html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>Add Employee</title>
<style type="text/css"/>
body {
font-family : tahoma;
}
</style>
</head>
<body>
<?php
include("config.php");
$tbl_name="test_mysql"; // Table name
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
$num_result = @mysql_num_rows($result);
echo $num_result;
?>
<div align="center">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="27%" height="20" id="table1">
<tr>
<div align="center">
<div align="center">
<table width="393" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<div align="center">
<table width="393" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<div align="center">
<table width="393" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<div align="center">
<table border="1" cellspacing="0" cellpadding="5" style="border-style: solid; border-width: 1px" bgcolor="#FFFFFF" width="468">
<tr>
<td align="center" width="227" >
<font color="#000000"><strong>Name</strong></font></td>
<td align="center" width="78" >
<font color="#000000"><strong>lastname</strong></font></td>
<td align="center" width="125" >
<font color="#000000"><strong>Email</strong></font></td>
</tr>
<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td width="227" align="center" bordercolorlight="#000000" ><b><?php echo $rows['name']; ?></b></td>
<td width="78" align="center" bordercolorlight="#000000" ><b><?php echo $rows['lastname']; ?></b></td>
<td width="125" align="center" bordercolorlight="#000000" ><b><?php echo $rows['email']; ?></b></td>
</tr>
<tr>
<td width="430" align="center" bordercolorlight="#000000" colspan="3" ><?php echo $rows['result']; ?></td>
</tr>
<?php
}
?>
<tr>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<?php
mysql_close();
?>
</body>
</html> كود: include("config.php");
$tbl_name="test_mysql"; // Table name
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
$num_result = @mysql_num_rows($result);
echo $num_result; كود: <td width="430" align="center" bordercolorlight="#FFFFFF" colspan="3" ><?php echo $rows['result']; ?></td> التعديل الأخير تم بواسطة : manindark بتاريخ 22-06-2008 الساعة 09:29 PM. | |||||
|
| |||||
|
السلام عليكم ورحمة اللة وبركاتة وهذا حل بعيد عن دالة mysql_num_rows واسرع ويظهر لك عدد النتائج التى فى المصفوفة فقط كود PHP: | |||||
|
![]() |
| |
| |
| أدوات الموضوع | |
| |
المواضيع المتشابهه | ||||
| الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
| ممكن طريقة الترقيه من 3.0.6 الى 3.5.3 | NoNo | إصلاح وصيانة المنتديات | 4 | 02-02-2006 02:32 AM |
| ممكن طريقة جلب حجم ملف معين في النت؟؟ | 7addad | تطوير الويب | 15 | 05-08-2005 09:44 AM |
| ممكن طريقة تصميم ثيم نيوك | arb4.com | تطوير الويب | 4 | 01-06-2005 07:24 PM |
| ممكن شرح طريقة " اعادة ترتيب الاقسام"؟؟؟ | elkaser | PHP | 1 | 31-01-2005 02:20 PM |
| شباب الله يخليكم ممكن طريقة تشغيل PHP Editor على الجهاز | producer | تطوير الويب | 1 | 16-11-2003 01:51 AM |