私は自分のmysqlデータベースでこのクエリを実行しています:
select email from main where phno=1234567890
これを返します(http://i.imgur.com/YiVQ4NN.png)
だからここにphpでの私の試みがありました:
$search_query="select email from main where phno = 5756407850";
$to = mysql_query($search_query);
echo "hello " . mysql_query($search_query);`
Webブラウザでの私の結果はhello Resource id #34
メール部分の内容だけを抽出するにはどうすればよいですか? この場合、「HGH」文字列だけですか?
答え:
$search_query="select email from main where phno = 5756407850";
$result = mysql_query($search_query);
$array = mysql_fetch_array($result);
$to = $array[0];
echo "hello " . $to;