mysql

Wordpress: How can I exclude posts in child taxonomies from a custom taxonomy query?

My WordPress theme has a custom taxonomy called "Collections". The custom taxonomy is hierarchical, so there are subcollections. I have a Collection called "Books" and a sub-collection called "Novels". There are some posts that are just in "Books", and some posts that are in "Novels". I want the page for the "Books" collection to only s...

Is it possible to extends a Model with Doctrine 2?

Following situation: Parent: namespace Base; /** @Entity @Table(name="section") */ class Section extends Skeleton { /** * @Id @Column(type="integer") * @GeneratedValue(strategy="AUTO") */ protected $id; /** @Column(length=256) */ protected $title; /** @Column(length=256) */ protected $stylesheet; } Child: namespace Base2; u...

PHP: Looping through and displaying data only if it's unique (dates)

I need to display a list of dates from a database. There can be multiple records with the same date, but I only want the date to display once. In other words, I need to only display unique dates. Any ideas? ...

special characters from iPhone causing POST error in SQL

I have an iPhone app which submits user entered data to a SQL database. It causes an error, either cuts off the data or enters "null" when special characters are used. Seems that apostrophes and question marks and periods are ok, but anything outside of that causes it to cut off the post or post nothing at all. My SQL Query to insert th...

PHP mySQL not letting me insert into a table

Hey, I'm using the code: function insertV($deptx, $coursex, $secx, $isbnx,$titlex, $authorx,$usedpx,$newpx) { $sql = "INSERT INTO `$deptx` (`course`, `sec`, `isbn`, `title`, `author`, `usedp`, `newp`) VALUES ('$coursex','$secx','$isbnx','$titlex','$authorx','$usedpx','$newpx')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysq...

mysql ’ show up as ’

Hi there, when I try and run: mysql -u myUser -pPassword -D myDatabase -h myHost < toInsert.sql from my ubuntu desktop where myHost is a remote Red Hat server and toInsert.sql contains ’ they show up as ’ How can I resolve this? Note! ’ is NOT the same as ' When I run toInsert.sql from a windows machine with a mysql gui client I ...

Best SQL Option for Performance

I currently need to execute a database query that involves data from three separate tables. (bases,member,sell_transaction) The bases table looks like the following base_id(PK)    name    state The member table looks like the following id(PK)    last_name    username   email    first_name The sell_transaction table has the following s...

SQL problem if two diffrent author have same name in books database

Just wanted to know what would happen if in my book database i had two different authors which have the same name. How could i redesign my database to sort this problem out? Do i have to assign primary and secondary keys or something? By the way this question is related to my previous one. ...

What collab. software do I need?

Hello, I'm in a bit of a situation right now. I need software that does the business side of Sharepoint. The software will be used in a company intranet. Ideally, I'd go with SharePoint, and although what I'm technially looking for is a PHP Sharepoint alternative, PHP is not tasked up to deal with the same tasks as SharePoint. What I d...

jQuery load with auto-refresh, passing variables in order

I have the following jquery code: $(".rotateNews").load("/load_news.php"); var refreshId = setInterval(function() { $(".rotateNews").load('/load_news.php?newsID='); }, 5000); This refreshes a div with the class rotateNews with load_news.php every 5 seconds. load_news.php pulls a random news article from a MySQL databas...

MySQL regex at runtime

SELECT telephone_number FROM table WHERE telephone_number REGEXP '^1[() -]*999[() -]*999[() -]*9999$'; how do i make so its valid for any number format and any number like 407-888-0909 1(408)998-7654 7776654433 876-7788 right now its only valid for 1-999-999-9999 ...

2 man project - java+database programmers

My friend and I are entering our final year at the university (M.Sc.) in 2 months and as such we have to start thinking about our dissertation (as we decided to write one together). After giving it some thought we came up with a topic which would involve both a lot of thinking and implementing, as we really wanted to do something practic...

Computing average time given set of start and end dates

Hey. I have a table with a field called date_start and a field called date_end The values of the field are like this year-month-day hours:minutes:seconds I need to find out: How much time it to for the person to complete the task. The average time it took of all of them. I'm still a bit new and honestly have no idea where to even...

MySQL clone a table, prune some data and then hotswap their names

We have a 8 million row MySQL table. We want to prune about 2m rows from it, remove some outdated indexes and add new ones. To achieve almost no downtime, our plan is to create a clone of the table (and lock the original), run a script (Ruby) to prune the data that we don't need anymore and finally add the new indexes. Then we would p...

MySQL timezone change?

How do I change my timezone which is currently in UTC to GMT +1, what is the correct line and do i just enter it in phpMyAdmin SQL execution? My host just gave me this link http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html and went off so I'm kinda lost thanks ...

MySQL: keep always the same value in two fields of different tables

Is there any way to keep always the same value in two fields of different tables? ...

problem when binding mysql tinyint with subsonic 3 and datagridview

i created a datalayer using subsonic. however when i am selecting my data, i get the following exception. System.ArgumentException was unhandled Message="Object of type 'System.Boolean' cannot be converted to type 'System.SByte'." Source="mscorlib" StackTrace: at System.RuntimeType.CheckValue(Object value, Binder binder...

Reorder the results of a mySQL query using PHP without performing another query

I don't know if this is possible. I display a table of results and want to be able to order the table by any of the columns. I don't need help making such a table; I just need information about reordering the results of a query without repeating it with a different ORDER BY instruction. ...

How to write "WHERE foo = 'bar' OR foo = 'baz' OR ..." without repeating "foo" each time

I'm new to MySQL and was wondering; instead of doing SELECT fields FROM table WHERE name="tim" OR name="bob" OR name="nancy" OR name="john" If I could do something like SELECT fields FROM table WHERE (name="tim" OR "bob" OR "nancy" OR "john") ...

search in mysql

how to do a mysql search for the following scenario? search term example: great state Mysql field, row 1 contains: great, city row 2 contains: awesome state row 3 contains: great state, and city So, on search, over the given term, it shud give me all the three rows above. what I want to achieve is, mysql shud search for the wor...