Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 58 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. DEFINE('DB_USER','root');
  2. DEFINE('DB_PSWRD','root');
  3. DEFINE('DB_HOST','localhost');
  4. DEFINE('DB_NAME','mydatabase');
  5.  
  6. $dbcon = mysqli_connect(DB_HOST,DB_USER,DB_PSWRD,DB_NAME);
  7.  
  8. if(!$dbcon){
  9.   die('error connecting to database');
  10. }
  11.  
  12. echo 'connected to database'; // displays this message
  13.  
  14. $sql = mysql_query("SELECT * FROM users where id='1'");
  15. $sqla = mysql_fetch_array($sql);
  16. do {
  17.   print $sqla['username']; // displays nothing
  18. }
  19. while($sqla = mysql_fetch_array($sql));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top