All web pages return http 500 not sure why

Yes Edwin what s the correct way to close PDO as it has no $con->close

my fetch is working fine so it not that either
http://www.deniserose.epizy.com/fetch_sql.php
this one works too but the styles are not working http://www.deniserose.epizy.com/my-music/

The values are still populating as i had o clear data today

1 Like

Actually i’m searching too. Can you read post next explain to me.
Pdo i told you have $con->close. does it.

Thanks but Not required its run from js/fetch_uptater.js as its more expansive that is how I used to do it long ago

Here Edwin PHP: Connections and Connection management - Manual.

close connection before fetch read:

<?php
    $servername = 'xxxxx';
    $dbname = 'xxxxx';
    $username = 'xxxxx';
    $password = 'xxxxx';

try {
    $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// execute the stored procedure
$sql = 'select id,  xxxxx   limit 300';

//echo $sql;
$q = $conn->query($sql);
//echo "hasil: " . $q->rowCount();
$q->setFetchMode(PDO::FETCH_ASSOC);
} catch (PDOException $pe) {
die("Error occurred:" . $pe->getMessage());
}
$conn = null;
?>

<?php while ($r = $q->fetch()): ?>


<?php
echo "";

echo $r['id'];
?>
<?php endwhile; ?>

I hv another one. wait.

Fetching with class bobdemo:

blobdemo.php (3.3 KB)

What is your blob demo Edwin?

Again it uses $blob = fopen($filePath, ‘rb’) which doesn’t seem to work on this infinity website. We have not had an answer why these fopen, fwrite( fread( fclose( does nothing from admin or if its all supported?

My example did not have any mime it just created byte array. The example you gave had no SQL file structure it was going into and there could be a MIME and data blob which is not discussed in depth. My routine was in regard to creating blob and used elsewhere:

var image = document.createElement("img");
image.src = 'http://www.deniserose.epizy.com/images/nowplaying_artwork_2.png?tr=w-200,h-200'
$b64Data= base64_decode($artwork);
const byteCharacters = atob(b64Data);
const byteNumbers = new Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
    byteNumbers[i] = byteCharacters.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
const blob = new Blob([byteArray], {type: contentType});

I am also this morning noting missing record creation again with no record in sql being created

@EdwinTigor Edwin, @wackyblackie @Admin @Greenreader9
I have this which is better but still have error with blob last line

<?php
$img = "http://www.deniserose.epizy.com/images/nowplaying_artwork_2.png?tr=w-200,h-200";
header('Content-Type: image/jpeg');
readfile($img);
$b64Data= base64_decode($img);
const byteCharacters = atob($b64Data);
const byteNumbers = array(byteCharacters.length);
for ($i=0; $i < byteCharacters.length; $i++) {
    byteNumbers[$i] = byteCharacters.charCodeAt($i);
}
const byteArray = new Uint8Array(byteNumbers);
const blob = new Blob(byteArray, { type: "text/html" });

imagedestroy($img);
?>

this give an error https://phpcodechecker.com/
end of file in your code on line 13

  • imagedestroy($img);

It also does not run idk any ideas please ?

I font think https://phpcodechecker.com/ uderstands blobs or a2b

@EdwinTigor @Greenreader9 @anon46092769 @AdminMarcus @wackyblackie

ttps://i.gyazo.com/329c0db759e3102733976dd1adc1526d.png

Its running but still not probably getting the 64 base from images but am unsure as you can see from the debugger it seems to be loading documents but they are not appearing on my webpage . i dont know why as this worked last time on my other website but not on yours it seems to be not referencing the objects on the page ?

The reason its running so any fetches is the base44 is not being provided

@Admin @EdwinTigor @wackyblackie @Greenreader9 @anon46092769

The fetch being provided when there is 150 lines or 79k . What I don’t know where this is going as its not appearing on my page no matter what I do. I checked ids are all correct … Is there some differant page handling here that i need to consider when referring to a live page please? or do you have a different page debugger that shows what being changed on a page please ?

The repeated fast nature implies no base64 is being provided Why is its why does this not come onto page were is it going can you tell me . I am not sure why your system is different from my last other than you are much nicer people :slight_smile:
Hugs D

Please stop @mentioning us/people. We will try to help you when we are available; after all, we are not paid support, we are community volunteers trying to help people out on our own time.

5 Likes

Wacky I said your all nice people I meant it. my other server site I dumped people was not nice. I was praising everyone here .

What is a verbose error in the chrome debugger how do i see the error please ?

Hi.
The example for php mysql.
Nothing wrong. I tested on thiz serv.
your code is for javascript base64 through local blob.

oh can you help then as i don’t understand

Yes Edwin, Hi , but I have it for php too which didn’t work with what should be valid php code I am not using java script for that input. I am only java to refresh page dynamic HTML . Did you test with what I sent with php ? its coming in as base64 already formatted passed as POST data which worked fine to create a image on server

I did this as i wanted to get it into the SQL from the image on screen and learn

<?PHP
$img = "http://www.deniserose.epizy.com/images/nowplaying_artwork_2.png?tr=w-200,h-200";
header('Content-Type: image/jpeg');
readfile($img);
$b64Data= base64_decode($img);
const byteCharacters = atob($b64Data);
const byteNumbers = array(byteCharacters.length);
for ($i=0; $i < byteCharacters.length; $i++) {
    byteNumbers[$i] = byteCharacters.charCodeAt($i);
}
const byteArray = new Uint8Array(byteNumbers);
const blob = new Blob(byteArray, { type: "text/html" });

imagedestroy($img);
?>

I wanted to do it this way to get the one off the page but could have used base 64 already in my code , however if this is above put in it breaks my add_track.php so there must be something wrong with it even though it was sourced from internet. My pages are still not writing to main page to update the live HTML appears not to work I have triple checked everything I can but dynamic html is failing on my site here. Something is preventing it functioning even in debugger it says its doing it :frowning:

1 Like

In fact its hopeless after leaving it all a week it no longer writes to SQL, when it was doing this much last week Sighs might have to start looking for another site to host it , again