Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. $t = select * from tabnlename where email=something
  2. mysql_fetch_array($t)
  3. echo $t['slot1'] . $t['slot1'] and on and on ...
  4.  
  5. supemail slot1 slot2 slot3 slot4 slot5
  6. opera@gmail.com somedata somedata somedata somedata somedata
  7. kaku@gmail.com somedata somedata somedata
  8. nashu@gmail.com somedata
  9.  
  10. select Count(*)
  11. from MyTable
  12. where email = $something
  13.  
  14. <?php
  15.  
  16. $link = mysql_connect("localhost", "mysql_user", "mysql_password");
  17. mysql_select_db("database", $link);
  18.  
  19. $result = mysql_query("SELECT * FROM table1 where email='stuff@email.com'", $link);
  20. $num_rows = mysql_num_rows($result);
  21.  
  22. echo "$num_rows Rowsn";
  23.  
  24. ?>
  25.  
  26. if ($t['slot1'] == "" ) {$s1 = $t['slot1'] ;}
  27. else {$s1notnull =$t['slot1'] ; }
  28. if ($t['slot2'] == "" ) {$s2 = $t['slot2'] ;}
  29. else {$s2notnull =$t['slot2'] ; }
  30. if ($t['slot3'] == "" ) {$s3 = $t['slot3'] ;}
  31. else {$s3notnull =$t['slot3'] ; }
  32. if ($t['slot4'] == "" ) {$s4 = $t['slot4'] ;}
  33. else {$s4notnull =$t['slot4'] ; }
  34. if ($t['slot5'] == "" ) {$s5 = $t['slot5'] ;}
  35. else {$s5notnull =$t['slot5'] ; }
  36.  
  37. $array_empty = array($s1, $s2, $s3, $s4, $s5);
  38. $how_is_empty = count($array_empty);
  39.  
  40. select email,slot1 as s1, slot2 as s2, slot3 as s3, slot4 as s4, slot5 as s5, (count(s1+s2+s3+s4+s5)) from tabnlename where email=something
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement