Last active
September 28, 2017 11:13
-
-
Save 16pxdesign/1127b89417568c2418e5b72334fec307 to your computer and use it in GitHub Desktop.
Help-full scripts to quick copy and paste
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT c.name, o.product | |
FROM costumers c | |
LEFT JOIN orders o | |
ON c.id = o.costumers_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dbname = 'dbname'; | |
$dbuser = 'root'; | |
$dbpass = 'password'; | |
$dbhost = 'HOST:3307'; | |
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to connect to '$dbhost'"); | |
mysql_select_db($dbname) or die("Could not open the database '$dbname'"); | |
$result = mysql_query("SELECT * FROM `zzz`"); | |
while ($row = mysql_fetch_array($result, MYSQL_NUM)) { | |
printf("ID: %s Name: %s <br>", $row[0], $row[1]); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment