Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "#" signify in MySql?

Tags:

php

mysql

joomla

I come from a SQL Server background and thought that it might mean it was a temporary table, but after reading up on MySql temp tables I don't think that's true.

I'm seeing it in the following context:

SELECT ID, Name FROM #_SomeName

UPDATE

This query is defined in a PHP string and then run against the MySQL Database. I'm not sure if that would make a difference or not...

here is the PHP code i'm running:

$query="select id, name from #__SomeName";
$db=&JFactory::getDBO();
$db->setQuery($query);
like image 645
Abe Miessler Avatar asked Apr 15 '26 21:04

Abe Miessler


1 Answers

In MySQL # is an end-of-line comment:

http://dev.mysql.com/doc/refman/5.1/en/comments.html

In JFactory, #__ is used as a place holder. See here:

http://docs.joomla.org/How_to_use_the_database_classes_in_your_script

like image 106
Mike Avatar answered Apr 17 '26 10:04

Mike



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!