All web pages return http 500 not sure why

You need to define it then.
before line 103 define thoze 4 params variables.

    $servername = 'xxxxxx';
    $dbname = 'xxxxxx';
    $username = 'xxxxxx';
    $password = 'xxxxxx';

I don’t know what you are suggesting @EdwinTigor , but you are messing things up that were working originally.

@anon14276620, I would put your SQL code back the way you had it before. Then, since you have completely lost me, please paste your code, and any error messages you have, here.

Thanks

3 Likes

she dont get her img base64 string.
she cannot saving data. or she can but no data str64 to saved to.

Am also getting Error occurred:SQLSTATE[HY000] [1203] User epiz_33087480 already has more than ‘max_user_connections’ active connections with $con=NULL is this not closing connection please in PDO?

Been working here http://www.deniserose.epizy.com/my-music/
As the fetch doesnt work as it not getting base64 from images.

Hugs

Hi Green

Yes it won’t read my image base64 from here js/fetch_updater.js commented out line which didnt work in below

const toDataURL = url => fetch(url)
  .then(response => response.blob())
  .then(blob => new Promise((resolve, reject) => {
    const reader = new FileReader()
    reader.onloadend = () => resolve(reader.result)
    reader.onerror = reject
    reader.readAsDataURL(blob)
  }))

var image = document.createElement("#img999");
    image.src = 'http://www.deniserose.epizy.com/images/nowplaying_artwork_2.png';

    var base64file1;
    var base64file1 = $("img999").attr("src");
    /*toDataURL("/images/nowplaying_artwork_2.png", function(data) {
        then(dataUrl => console.log('RESULT:', dataUrl));
        base64file1 = dataUrl;
        });
    */
    image.remove();
    //base64file1 = base64_encode(base64file1);
    //var base64file2 =  document.getElementById("outer_img").GetElementsById("np_track_artwork").src.data;
    //var base64file2 = $("img#np_track_artwork").attr("src", "data:image/png;base64,"+data);
    
    var base64file2 = $("#np_track_artwork").attr("src");
1 Like

I saw the post is solved “max_user_connections” pdo:

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