I am trying to create a category menu with sub categories. I have the following MySQL table:
--
-- Table structure for table `categories`
--
CREATE TABLE IF NOT EXISTS `categories` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(1000) NOT NULL,
`slug` varchar(1000) NOT NULL,
`parent` int(11) NOT NULL,
`type` varchar(25...
Hey everyone,
I want to make a code snippet database web application. Would the best way to store it in the database be to html encode everything to prevent XSS when displaying the snippets on the web page?
Thanks for the help!
...
I have this piece of logic I would like to implement as a trigger, but I have no idea how to do it! I want to create a trigger that, when a row is deleted, it checks to see if the value of one of its columns exists in another table, and if it does, it should also perform a delete on another table based on another column.
So say we had a...
I have a vb.net program that uses mysql as its database. And it works when the computer has wampservr installed. But the program gets an unhandled exception error when the computer where its running does not have a wampserver. The only thing that is installed in it is the mysql connector net. How do I make it work. I just want the two pr...
Hi
I have the following PHP code doing a very simple select into a table.
$statement = $db->prepare("SELECT * FROM account WHERE fbid = :fbid");
$statement->bindParam(":fbid",$uid, PDO::PARAM_STR,45);
$out = $statement->execute();
print_r($out) // 1;
//$out = $statement->execute(array(':fbid' => $uid)); // also doesn't work
$row = $sta...
i am using prototype.js
...
whats the best way to synchronize few tables of mysql server with postgreSQL server,
currently people are executing scripts, which takes much time, is there any fast solution available from which we can map the tables and columns to synchronize the db server.
...
I have a CMS content in database. The content contains '<img src= .............../>' also.
I want to retrieve this content using mysql query and show on frontend but with all '<img src='.........../>' removed from the content.
How can it be done using query in mysql?
...
Disclaimer: let me know if this question is better suited for serverfault.com
I want to store information on music, specifically:
genres
artists
albums
songs
This information will be used in a web application, and I want people to be able to see all of the songs associated to an album, and albums associated to an artist, and artis...
Ok, I need something like this:
datediff(second, date_one, date_two) < 1
dates are stored in a column 'datetime' type
UPDATE
I want to find dates which differ in less than several (say, 10) seconds
...
I am trying to replicate a forum function by getting the last reply of a post.
For clarity, see PHPBB: there are four columns, and the last column is what I like to replicate.
I have my tables created as such:
discussion_id (primary key)
user_id
parent_id
comment
status
pubdate
I was thinking of creating a Link Table that would u...
I am working on an issue management system, developed in PHP/MySQL.
It requires search functionality, where the user will mention the search parameters and based on these parameters the system will return the result set.
To solve this I am trying to write a function and all the user selected parameters are passed as arguments. Based on ...
Hi,
when I write a sql statement in php, i usualy write it as below
SELECT COUNT(*) FROM catalogsearch_query AS main_table
but I found that some people write sql statement like
SELECT COUNT(*) FROM `catalogsearch_query` AS `main_table`
do I have to use ` ?
...
Is there any free tool for profiler of MYSQL database?
I want to capture the SQL statement from application.
and want to tune it for performenencae.
Can any one suggest?
Thanks,
Paresh
...
I'm currently looking for a QBE tool that can execute
queries on PostgreSQL or MySQL.
OS doesn't really matter.
Reason is that we've got to do QBE at school but I don't want to use neither Microsoft Access nor OpenOffice.org Base (lack of features).
Any help would be appreciated.
...
Hi,
This might be an easy one, but I'm not really experienced with sql.
I have a table with two user_id columns, user1 and user2. This table contains some compared values between the two users.
I want to send in an user id, and return all the id's from the other user when the sent user is either user1 or user2.
I guess some sort of i...
I've learned that MySQL can compress communication between servers and clients.
Compression is used if both client and
server support zlib compression, and
the client requests compression.
(from MySQL Forge Wiki)
The most obvious pros and cons are
pros: Reduced payload size
cons: Increased computation time
So, is compresse...
Hi,
I'm setting up a group / user based security system.
I have 4 tables as follows:
user
groups
group_user_mappings
acl
where acl is the mapping between an item_id and either a group or a user.
The way I've done the acl table, I have 3 columns of note (actually 4th one as an auto-id, but that is irrelevant)
col 1 item_id (item...
If been using "dbForge Query Builder" lately and I'm gotten used to the ease of building and testing a query, specially for those complex ones with inner joins, aliases and multiple conditionals.
The expiry date of the trial is about to come, and while wanting to remain on the legal side for this I'd rather not pay the 50USD it costs (a...
Is there an equivalent of (ADO.NET) DB.Null in JDBC? Or do I simply pass null in the parameter?
Particularly in the context of Mysql?
...