Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $username = "root";
- $password = "luca170385";
- $hostname = "localhost";
- $dbhandle = mysqli_connect($hostname, $username, $password)
- or file_put_contents($filename, date("Y-m-d H:i:s")."Unable to connect to database", FILE_APPEND);
- echo "Connect to MySQL<br>";
- $selected = mysqli_select_db($dbhandle , "accounts")
- or file_put_contents($filename, date("Y-m-d H:i:s")."Could not select database<br>", FILE_APPEND);
- echo "Selected Database<br>";
- $sql = "SELECT `address` FROM `url` WHERE `code` IS NULL";
- if ($result = mysqli_query($dbhandle, $sql)){
- while ($row = mysqli_fetch_assoc( $result));{
- printf ($row['address']);
- $output = "{$row['address']}";
- echo "{$row['address']}";
- $handle = curl_init($sql);
- curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);
- $response = curl_exec($handle);
- $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
- $update = "UPDATE url SET `code`= $httpCode WHERE `address` = $sql";
- echo "$update.<br>";
- echo "$handle.<br>";
- echo "$httpCode.<br>";
- mysqli_query($dbhandle, $update);
- echo "{$row['address']}";
- curl_close($handle);
- }
- }else {
- echo 'Not working';
- }
- while ($row = mysqli_fetch_assoc( $result));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement