close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Error message with simple MySQLi page

Thread began 7/04/2014 10:49 am by msummers194171 | Last modified 9/26/2014 12:45 pm by Jason Byrnes | 4123 views | 7 replies |

msummers194171

Error message with simple MySQLi page

I've recently installed the MySQLi extension and am just making a simple page. My page looks like this -

<?php
ini_set('display_errors', 1); ?>
<?php require_once('Connections/connMySQLi.php'); ?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php
$rsQuotes = new WA_MySQLi_RS("rsQuotes",$connMySQLi,10);
$rsQuotes->setQuery("SELECT quotes.quotes_quote FROM quotes WHERE quotes.quotes_display=1");
$rsQuotes->execute();
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<?php
while(!$rsQuotes->atEnd()) {
?>
<p><?php echo($rsQuotes->getColumnVal("quotes_quote")); ?></p><br>
<?php
$rsQuotes->moveNext();
}
?>
</body>
</html>

My Connection file looks like this (and it tests OK, as does the recordset on the simple page) -

<?php
# FileName="WADYN_MYSQLI_CONN.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connMySQLi = "123.123.123.123";
$database_connMySQLi = "database";
$username_connMySQLi = "user";
$password_connMySQLi = "password";
@session_start();
$foundConnection = false;
if ($foundConnection == false) {
$domains = explode(",","example.com");
for ($domindex = 0; $domindex<sizeof($domains) && !$foundConnection; $domindex++) {
$domainCheck = trim($domains[$domindex]);
if (strpos(strtolower($_SERVER["SERVER_NAME"]),strtolower($domainCheck)) !== false && ($domainCheck == "" || strpos(strtolower($_SERVER["SERVER_NAME"]),strtolower($domainCheck)) == strlen($_SERVER["SERVER_NAME"])-strlen($domainCheck))) {
$hostname_connMySQLi = "localhost";
$database_connMySQLi = "database";
$username_connMySQLi = "user";
$password_connMySQLi = "password";
$foundConnection = true;
}
}
}

$connMySQLi = new mysqli($hostname_connMySQLi, $username_connMySQLi, $password_connMySQLi, $database_connMySQLi);

?>

(The code has been 'sanitized')

When I upload these files and browse to the page, I get this error -

Fatal error: Allowed memory size of 104857600 bytes exhausted (tried to allocate 4294967296 bytes) in /home/example/public_html/webassist/mysqli/rsobj.php(224) : eval()'d code on line 1

Any idea why I am getting that?

Sign in to reply to this post

Jamie

Not sure if the same, but check out this thread http://www.webassist.com/forums/posts.php?id=34751

Hope it helps

Jamie

Sign in to reply to this post

msummers194171

Thanks, Jamie - I'll see if that has any effect, although I am skeptical. What I'm trying to do is simply retrieve 20 or so paragraphs of content and display them in a repeat region.

It is curious that the error messages are pretty much the same though...

Sign in to reply to this post

tom113673

I came across this problem too. The solution was to make some changes to the MySQL table concerned. I had some fields defined as MEDIUMTEXT when TEXT would have been sufficient (and more efficient); changing them to TEXT fixed the problem.

There was no problem using the original table with the mysql extensions as opposed to the mysqli extensions. I suspect it's to do with PHP's mysqli extensions rather than the new DW extension.

Sign in to reply to this post

msummers194171

Tom - thanks! That was it. Who would have thought to make that change? In my case I had a field defined as longtext and when I changed it to just text, the process worked without error.

Sign in to reply to this post

tom113673

I'm glad I could help.

Sign in to reply to this post

markhaynes75235

MySQLi and LONGTEXT Data Type

I ran into a similar problem this week using the MySQLi extension. Whenever my recordset returned data from a field that was defined as LONGTEXT data type, the data showed up in part in the Recordset dialog's Test window but nothing would appear on the page or in live preview. Fortunately for me, changing those fields to TEXT datatype worked since none of them exceeded 65,535 characters.

I did some further research and came across this article in Stackoverflow which might help others:
http://stackoverflow.com/questions/10335278/prepared-mysqli-select-statement-on-longtext-field-is-coming-back-empty

Perhaps Ray's team can add some code that checks to see if the field being queried is of type LONGTEXT or MEDIUMTEXT and if this is true, the necessary Store Results can be added.

Sign in to reply to this post

Jason ByrnesWebAssist

Thanks Mark, i have forwarded this information to Ray and logged a bug so it can be corrected in the next update.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...