PHP mysql_fetch_array() ফাংশন
সংজ্ঞা ও ব্যবহার
mysql_fetch_array() ফাংশন ফলাফল সেট থেকে একটি পয়েন্ট নিয়ে সংযোগ আইনা, নম্বর আইনা বা উভয়ই ফিরিয়ে দেয়
ফলাফল সেট থেকে পাওয়া পয়েন্টস অনুযায়ী আইনা তৈরি করে।যদি আর কোন পয়েন্ট থাকবে না তবে false ফিরিয়ে দেয়
সংজ্ঞা
mysql_fetch_array(data,array_type)
পারামিটার | বর্ণনা |
---|---|
data | বাছাইকৃত।যে ডেটা পাইন্টার ব্যবহার করবেন তা নির্ধারণ করুন |
array_type |
বাছাইকৃত।যে ফলাফল ফিরিয়ে দেওয়া হবে তা নির্ধারণ করুন
|
Tips and Comments
Note:mysql_fetch_array() is mysql_fetch_row() of the extended version. In addition to storing data in the array with numeric indices, data can also be stored as associative indices, using field names as key names.
Tip:An important point must be noted, using mysql_fetch_array() is not obviously better than using mysql_fetch_row() Slow and also clearly provides more values.
Note:The field names returned by this function are case-sensitive.
Example
<?php $con = mysql_connect("localhost", "hello", "321"); if (!$con) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db("test_db",$con); $sql = "SELECT * from Person WHERE Lastname='Adams'"; $result = mysql_query($sql,$con); print_r(mysql_fetch_array($result)); mysql_close($con); ?>
Output similar to:
Array ( [0] => Adams [LastName] => Adams [1] => John [FirstName] => John [2] => London [City] => London )