php fetch mysql result as variable

Solutions on MaxInterview for php fetch mysql result as variable by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "php fetch mysql result as variable"
Ariadna
06 Sep 2019
1<?php
2$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
3if (!$result) {
4    echo 'Could not run query: ' . mysql_error();
5    exit;
6}
7?>