السلام عليكم
هل هناك طريقة لانشاء table وتحديد مساحتها، على ان لا تزيد محتوياتها عن ال 10 ميجا بايت على سبيل المثال؟؟
وان كان فعلاً بالامكان فعل ذلك... هل هناك طريقة لمعرفة حجم ال table الحالي؟ أو استرجاعه عن طريق ال php مثلاُ ؟؟
السلام عليكم
هل هناك طريقة لانشاء table وتحديد مساحتها، على ان لا تزيد محتوياتها عن ال 10 ميجا بايت على سبيل المثال؟؟
وان كان فعلاً بالامكان فعل ذلك... هل هناك طريقة لمعرفة حجم ال table الحالي؟ أو استرجاعه عن طريق ال php مثلاُ ؟؟
"My ambition exceeds my talent"
Best Regards

يا اخوان هذا السؤال محيرني لأني اوجه مشاكل الآن لا تحل إلا بالجواب على هذا السؤال ... يبدو انه لا توجد طريقة واضحة لفعل ذلك..
ولذلك قد استبدل سؤالي بسؤال آخر وارجو ممن يملكون الخبرة ووقت الفراغ مساعدتي بذلك واسمحو لي انا أكتب باللغة الانجليزية لاني بطئ بالعربي :unsure:
I a am developing an email system, and i need an advice for the structure of table to be used. The system should be as following:
Each user has an account.
User account consists of limited inbox with specific size 10 MG. Sent items, and trash bin
User can send and receive attachments, can send more than one, and receive more than one..
in fact the attachments issue and where to store files is my second problem. i will add my tables structure below.. and any help is appreciated in advance..
---------------------------------------------------------------------------------------------------------------------------
after you check the attached file there is an important note.. when a user sign up two tables will be created automatically `Username`_inbox and `Username`_attachments
means that each user will have 2 tables one for inbox and one for attachments, is it an efficient way to store information.
"My ambition exceeds my talent"
Best Regards

لا يمكن تحديد خجم الجدول بميسكول.
هناك طريقتين لتعرف حجم الجدول، الاولى هيا من خلال ملف data لل mysql والتي لن تستطيع معرفتها الا اذا كنت انتا مالك السرفر.
والثانية وهيا الاسهل:
<?php //اسم قاعدة البينات $database = 'database'; //اسم الجدول $table = 'table_name'; //معلومات الاتصال mysql_connect ( 'localhost', 'user', 'pass' ); $sql = "SHOW TABLE STATUS FROM " . $database . " LIKE '" . $table . "'"; $r = mysql_query ( $sql ); $data = mysql_fetch_assoc ( $r ); $len = ( doubleval ( $data['Data_length'] ) + doubleval ( $data['Index_length'] ) ); $total = number_format ( ceil ( $len / 1024 ) ); //الحجم بالكيبيتز echo $total . ' KBytes'; ?>
مع السلامة
شكراً لك على المعلومة القيمة
وذا كان بالامكان الاجابة على السؤال الثاني سأكون ممتن جداً
"My ambition exceeds my talent"
Best Regards

If you want to proceed with using database as the structure for your email storage, then you might as well store the files on some directory beneath public_html and just store the sizes in MYSQL or you can store the files themselves as binary in mysql if they are not big.
If you want my advise, using mysql to store emails is recommeneded only if you have a dedicated server running at mimum 2.8 ghz, and you might need more cpus if you get more customers. What I recommed you do is use file storage system (like outlook uses) to store and retireve emails.
Salam,
هذا الموضوع مغلق.