Thursday, 18 September 2014 13:47
beggarly

mysql_insert_id error?

Report Xmap bugs on this forum.

mysql_insert_id error?

Postby ExypherIT » Thu Apr 17, 2008 1:14 am

I receive the following error when I install 1.1 on a fresh Joomla 1.5.2 install:

Code: Select all
Settings table created

Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in /mnt/target01/012345/www.my-domain.com/web/content/administrator/components/com_xmap/classes/XmapSitemap.php on line 146
Default Settings inserted


The error continues to rear its head everywhere I look within the component after installation.

I'm currently using Mosso's Hosting "Cloud". Right now my cluster is configured with Apache/suPHP/MySQL5 using mysqli. FTP is disabled in Joomla and suphp in use to avoid having to set ownership of files to allow the installation of add-ons.

Any and all assistance would be greatly appreciated!
ExypherIT
Fresh Boarder
Fresh Boarder
 
Posts: 2
Joined: Thu Apr 17, 2008 2:03 am

Re:mysql_insert_id error?

Postby altum » Fri Apr 18, 2008 4:10 am

I have exactly the same problem on my clustered hosting with Servage.net.
I hope that you can fix this problem very soon, because for native Joomla 1.5, there is not much out there...

If you can't reproduce this problem, please send me an email and I will install a fresh J1.5 installation on my hosting, so you can test new versions for fixing the problem.

Thanks!
Geert
altum
Fresh Boarder
Fresh Boarder
 
Posts: 1
Joined: Fri Apr 18, 2008 5:05 am

Re:mysql_insert_id error?

Postby ExypherIT » Wed Apr 23, 2008 12:14 am

Anyone?

Anyone in a cluster environment NOT have this problem?
ExypherIT
Fresh Boarder
Fresh Boarder
 
Posts: 2
Joined: Thu Apr 17, 2008 2:03 am

Re:mysql_insert_id error?

Postby lewko » Sun Apr 27, 2008 7:21 am

I have received a similar error and my host (netregistry.com.au) is also using load-sharing clusters. I'm running latest stable versions of Joomla 1.5 and Xmap.

Upon installation, I received the following error (note path is santitised with *** for privacy):

Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in /clientdata/clients/*/*/**[ourdomain]**/www/administrator/components/com_xmap/classes/XmapSitemap.php on line 146

Subsequently, whenever I call the module, I receive a stack of errors thus :

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /clientdata/clients/*/*/*[ourdomain]*/www/administrator/components/com_xmap/classes/XmapSitemap.php on line 74

and

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /clientdata/clients/*/*/*[ourdomain]*/www/administrator/components/com_xmap/classes/XmapSitemap.php on line 74


I don't know if it's relevant, but I wonder if this has something to do with the path to the SQL Database. On our server, due to the load-balancing it is not stored on Localhost and I couldn't find anywhere to configure the database address.
Last edited by lewko on Thu Jan 01, 1970 12:00 am, edited 65535 times in total.
Reason: 1
lewko
Fresh Boarder
Fresh Boarder
 
Posts: 4
Joined: Sun Apr 27, 2008 5:14 am

Re:mysql_insert_id error?

Postby alias.mac » Sun May 04, 2008 4:45 pm

Hi!

Had the same problem on 1.5.2 (updated recently to 1.5.3) the bug continued so I tried to fix it (because I really need a sitemap).

So I searched the code and the problem was because I was using mysqli (improved mysql for php).

So I extracted the zip file (com_xmap-1.1_for_Joomla_1.5.zip) and opened the com_xmap/classes/XmapSitemap.php file and changed this lines (diff code):

Code: Select all
70d69
<       $db = & JFactory::getDBO();
75c74
<          $lines[] = $db->getEscaped($menutype).','.intval($menu->ordering).','.$show.','.$showXML.','.$db->getEscaped($menu->priority).','.$db->getEscaped($menu->changefreq);
---
>          $lines[] = mysql_real_escape_string($menutype).','.intval($menu->ordering).','.$show.','.$showXML.','.mysql_real_escape_string($menu->priority).','.mysql_real_escape_string($menu->changefreq);
147c146
<          $this->id = $db->insertid();
---
>          $this->id = mysql_insert_id( $db->_resource );


Then I ziped the folder and installed it normally and it worked... no more errors/warnings.

My host is also using load-sharing clusters, but I don't think that was the problem.

I hope this will help you and good luck to all.

BTW thanks for this joomla component!
alias.mac
Fresh Boarder
Fresh Boarder
 
Posts: 4
Joined: Sun May 04, 2008 5:33 pm

Re:mysql_insert_id error?

Postby lewko » Sun May 04, 2008 8:27 pm

Sorry. I have no idea how to decipher your diff code.

Any chance you could paste a simple how-to version for us beginners?
lewko
Fresh Boarder
Fresh Boarder
 
Posts: 4
Joined: Sun Apr 27, 2008 5:14 am

Re:mysql_insert_id error?

Postby alias.mac » Sun May 04, 2008 9:37 pm

Sure!

Sorry about that... I'll upload the file for you.

Just overwrite the file that is on the zip with this one on com_xmap/classes folder, then make a zip file with all the files and upload the zip you've just created. And that's all.

I hope this will help you!

Good luck.

Well... I can't upload php files... I'll have to tell you the lines then:

on line 70 add this:

$db = & JFactory::getDBO();

on line 75 (previous 74) change it to look like:

$lines[] = $db->getEscaped($menutype).','.intval($menu->ordering).','.$show.','.$showXML.','.$db->getEscaped($menu->priority).','.$db->getEscaped($menu->changefreq);

on line 147 (previous 146) change it to look like:

$this->id = $db->insertid();

That's all feedback if any trouble
Last edited by alias.mac on Thu Jan 01, 1970 12:00 am, edited 65535 times in total.
Reason: 1
alias.mac
Fresh Boarder
Fresh Boarder
 
Posts: 4
Joined: Sun May 04, 2008 5:33 pm

Re:mysql_insert_id error?

Postby lewko » Sun May 04, 2008 10:36 pm

It seems to work :woohoo:

The error messages have gone and for the first time, I can produce a functioning sitemap.

I'll check it over the next week to see how it performs and whether the clustering introduces any issues, however I'm very happy.

Well done!
lewko
Fresh Boarder
Fresh Boarder
 
Posts: 4
Joined: Sun Apr 27, 2008 5:14 am

Re:mysql_insert_id error?

Postby alias.mac » Sun May 04, 2008 10:38 pm

no prob! ;)
alias.mac
Fresh Boarder
Fresh Boarder
 
Posts: 4
Joined: Sun May 04, 2008 5:33 pm

Re:mysql_insert_id error?

Postby guilleva » Mon May 05, 2008 12:15 am

Thanks alias.mac! I'll update the package with your fix!

Thank you again!
User avatar
guilleva
Administrator
Administrator
 
Posts: 1527
Joined: Wed Sep 12, 2007 3:10 am
Location: San José, Costa Rica

Next

Return to Bugs



Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest