I am stuck - I have two tables (Table A and Table B).
These have different number of columns - Say Table A has more columns.
How can I union these two table and get null for the columns that Table B does not have?
...
What I am trying to do is display the Table name then each of it's field names after it.
it seems to work until i get to my character table, it will not display the field names and returns me this error.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ...
How do I force indexes on a query similar to this. I need to force an index on foo and bar individually.
SELECT foo.*, bar.*
FROM foo
INNER JOIN bar ON foo.rel_id = bar.rel_id
WHERE foo.status = 1
AND bar.status = 1
...
Im considering apply an index of 3 fields (type, status, user_id) on a table. The majority of my queries have WHEREs that use all 3. However, I have a couple of heavily used queries which only use 2 fields (type and status).
My question, is would creating an index with all 3 fields be used efficiently by queries that only really compar...
Hello,
I would like to select some data and put first letter of title field into another field. Is it possible?
auto
business
Sports
1st offer
I want to get something like that
a|auto
b|business
s|Sports
0|1st offer
0 = any non alphabetic character
Thank you.
...
I am looking for the best way to retrieve the next and previous records of a record without running a full query. I have a fully implemented solution in place, and would like to know whether there are any better approaches to do this out there.
Let's say we are building a web site for a fictitious greengrocer. In addition to his HTML p...
Hi friends,
After having seriously database loosing problems, I decided to go for an autobackup system. I researched and AutoMySQLBackup looks fine.
I use Bluehost, where should I locate the automysqlbackup.sh file? I just worry about security issue. Also, where should we locate the backup files?
Appreciate! thanks a lot!
...
I am reading a 'kind' of csv file and exploding it and storing it in array.
The file I am reading has this structure
Id,Log,Res,File
mydb('Test1','log1','Pass','lo1.txt').
mydb('Test2','log2','Pass','lo2.txt').
mydb('Test3','log3','Pass','lo3.txt').
Now what I am trying to do is :
reading the last record in my database, get the Name...
I have a classifieds website, and users can search ads.
The results are displayed in three tabs on top of the page. These three are "All", "Private", and "Company".
Each tab has a nr attached to it, which represents the nr of ads found in that tab.
So for example:
All Private Company
5 3 2
All is just ...
I have a sql issue with column names in a subselect im guessing its because it has yet to be assigned that name but I cannot work out how to rearange it.
select Distinct Captains.Name, Captains.Team, (select count(Winners.Name) from (select HomeTeamCaptain As Name from fixture where fixture.HomeTeamCaptain = Captains.Name And fixture.ma...
I've got a simple SQL query that keeps throwing an SQL syntax error. It looks like this:
$sql = "SELECT COUNT(*) AS TOTAL FROM PRODUCT WHERE ID_PRODUCT = ".$id;
$result = mysql_query($sql) or die(mysql_error());
Which throws :
You have an error in your SQL syntax;
check the manual that corresponds to
your MySQL server version...
Does derby support REPLACE INTO of mysql?
...
this is driving me crazy why aren't the results showing???
function runSQL($rsql) {
$connect = mysql_connect('localhost','xxx','xxx') or die ("Error: could not connect to database");
$db = mysql_select_db('xxx');
$result = mysql_query($rsql) or die ("Error in query: $query. " . mysql_error());
return $result;
mysq...
I am having trouble storing array contents in mysql
I am using the code below
foreach($found_entry as $key => $sd) {
echo "$key => $sd <br>";
$insert_found_row = mysql_query("INSERT INTO myTable values ID = \"$sd[0]\" ,Folder = \"NULL\", Tsi = \"$sd[11]\", PT= \"NA\" ") or die(mysql_error());
echo "$sd";
If I ec...
I have a new table I'm going to add to a bunch of other summarized data, basically to take some of the load off by calculating weekly avgs.
My question is whether I would be better off with one model over the other. One model with days of the week as a column with an additional column for price or another model as a series of fields ...
I'm run this query:
SELECT id,like - dislike as result
FROM mytable
Where the column like and dislike are unsigned integer. If the column dislike is greater than like mysql return number like 18446744073709551596, so seem that mysql treat this like unsigned and can't return negative number but continue the computation from a sort of M...
I'm new to JOINS in MySql.
I have six tables: t1, t2, t3, t4, t5, t6.
And I also have one main table: main_table.
TOTAL 7 TABLES!
The first column of ALL tables is called classified_id.
If the user searches for "cars" then the main table will match everything in table t1 (which is the cars table) where classified_id is the same in bot...
Does derby have any capabilities from performing a batch insert of data from a CSV? The best I could come up with was to read in the file line by line and create a batch sql update statement and run that. For 1 million rows that took between 30-40 minutes, as compared with using mySQL's LOAD statement to load from a csv file which took 2...
All of our tables are currently set with a LATIN1 character set. A user is currently capable of putting together unicode sequences on the client and trying to embed them into our application. What's the best way to discard all Unicode characters from hitting our database? Even better, that's the best way to ensure that only characters ba...
Hey all-
So I'm trying to figure out best practices on my database connection. I have a large .NET GUI that serves as the front end for the MySQL db. Currently I open a connection on application load and use it for whatever interactions I need. However, the entire GUI is single-threaded.
As I start to add BackgroundWorkers for large...