<?xml version="1.0" encoding="utf-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>DaniWeb IT Discussion Community - MySQL</title>
		<link>http://www.daniweb.com/forums/</link>
		<description><![CDATA[Our MySQL forum is the place for Q&A-style discussions related to this open source database. LAMP developers will appreciate our PHP forum.]]></description>
		<language>en-US</language>
		<lastBuildDate>Sun, 22 Nov 2009 08:21:08 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.daniweb.com/alphaimages/misc/rss.jpg</url>
			<title>DaniWeb IT Discussion Community - MySQL</title>
			<link>http://www.daniweb.com/forums/</link>
		</image>
		<item>
			<title>ISO-8859-1 SQL error</title>
			<link>http://www.daniweb.com/forums/thread240291.html</link>
			<pubDate>Sat, 21 Nov 2009 18:49:22 GMT</pubDate>
			<description><![CDATA[when I try to create a new mail account in my mail broadcast control center I get this message: 
 
SQL error: swd_act : ERROR: 1146 - Table 'craftyartsalesmailcatcher.swd_account' doesn't existContent-Type: text/html; charset=ISO-8859-1 SQL error: INSERT INTO swd_account (`isact` , `name`) VALUES...]]></description>
			<content:encoded><![CDATA[<div>when I try to create a new mail account in my mail broadcast control center I get this message:<br />
<br />
SQL error: swd_act : ERROR: 1146 - Table 'craftyartsalesmailcatcher.swd_account' doesn't existContent-Type: text/html; charset=ISO-8859-1 SQL error: INSERT INTO swd_account (`isact` , `name`) VALUES ('1' , 'swd_act') : ERROR: 1146 - Table 'craftyartsalesmailcatcher.swd_account' doesn't existStatus: 302 Moved Location: /cgi-bin/amlmlite4/responder.cgi?ses=cTb7C4Sps3MkZBHvZLY_It8ry&amp;act=account <br />
<br />
any help with this?<br />
thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>CRAFTYARTS</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread240291.html</guid>
		</item>
		<item>
			<title>Decrypt of Password</title>
			<link>http://www.daniweb.com/forums/thread239995.html</link>
			<pubDate>Fri, 20 Nov 2009 11:17:14 GMT</pubDate>
			<description>Dear Users, 
 
I have used SHA1 encryption method to encrypt password and stored in login table as a blob field. 
 
Now, to authenticate the password, i need to decrypt it. I am not able to decrypt. 
 
Please help me to decrypt password</description>
			<content:encoded><![CDATA[<div>Dear Users,<br />
<br />
I have used SHA1 encryption method to encrypt password and stored in login table as a blob field.<br />
<br />
Now, to authenticate the password, i need to decrypt it. I am not able to decrypt.<br />
<br />
Please help me to decrypt password</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Pranesh_Ashrit</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239995.html</guid>
		</item>
		<item>
			<title>MySQl Stored Procedure passing Parameters with parameter name and values</title>
			<link>http://www.daniweb.com/forums/thread239983.html</link>
			<pubDate>Fri, 20 Nov 2009 10:31:31 GMT</pubDate>
			<description><![CDATA[IN MySQl Stored Procedure how to pass Parameters with parameter name and values i.e. 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code...]]></description>
			<content:encoded><![CDATA[<div>IN MySQl Stored Procedure how to pass Parameters with parameter name and values i.e.<br />
 <pre style="margin:20px; line-height:13px">DELIMITER //<br />
&nbsp; CREATE PROCEDURE GetOffice<br />
(countryName VARCHAR(255), countryId int(11))<br />
&nbsp; &nbsp;  BEGIN<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  SELECT city, phone <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  FROM offices<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  WHERE country = countryName AND <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; country_id = countryId;<br />
&nbsp; &nbsp;  END //<br />
&nbsp; DELIMITER ;<br />
<br />
<br />
CALL GetOffice(&quot;India&quot;,1);</pre>This works fine but i want it the way --------<br />
CALL GetOffice(countryName= &quot;India&quot;,countryId=1);<br />
<br />
<br />
Is there any way to pass parameters to stored procedure along parameter names in MySql.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>sonikadugar</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239983.html</guid>
		</item>
		<item>
			<title>Help in a loop query</title>
			<link>http://www.daniweb.com/forums/thread239930.html</link>
			<pubDate>Fri, 20 Nov 2009 05:50:55 GMT</pubDate>
			<description>I have database with a table called orders. The structure is below 
 
Index,    OrderIndex,    OrderNo 
 111,               1 
 112 ,              1 
 113 ,              1  
 114 ,              2 
 115 ,              3 
 116 ,              3</description>
			<content:encoded><![CDATA[<div>I have database with a table called orders. The structure is below<br />
<br />
Index,    OrderIndex,    OrderNo<br />
 111,               1<br />
 112 ,              1<br />
 113 ,              1 <br />
 114 ,              2<br />
 115 ,              3<br />
 116 ,              3<br />
<br />
I want a query that will loop thorugh the database and make the result<br />
<br />
Index,    OrderIndex,    OrderNo<br />
 111,               1,                1<br />
 112,               1,                2<br />
 113,               1,                3<br />
 114,               2,                1 <br />
 115,               3,                1 <br />
 116,               3,                2<br />
<br />
Im trying to change the OrderNo based on the OrderIndex.<br />
<br />
Is there a way to do this purely using sql? If possible please help.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>blessanm</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239930.html</guid>
		</item>
		<item>
			<title>SQL query noob...</title>
			<link>http://www.daniweb.com/forums/thread239837.html</link>
			<pubDate>Thu, 19 Nov 2009 20:23:03 GMT</pubDate>
			<description><![CDATA[Hi, I have a question regarding a SQL query. I am a complete noob, so please do not make fun of me. 
 
Here is a schema that I created: 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a...]]></description>
			<content:encoded><![CDATA[<div>Hi, I have a question regarding a SQL query. I am a complete noob, so please do not make fun of me.<br />
<br />
Here is a schema that I created:<br />
<br />
 <pre style="margin:20px; line-height:13px">JOURNALS(j_num, j_name, j_subject_area, chief_editor_r_ssn)<br />
ISSUES(j_num, i_num, i_date, i_num_pages)<br />
RESEARCHERS(r_ssn, r_name, r_address, r_phone, r_institution)<br />
ARTICLES(art_num, art_title, art_area_topic, art_abstract, j_num_submitted,date_submitted, j_num_published, i_num_published)<br />
AREA_EDITS(j_num, r_sssn)<br />
WRITES(r_ssn, art_num)<br />
REVIEWS(r_ssn, art_num)<br />
RESEARCH_SPECIALTIES(r_spec_name)<br />
RRS(r_ssn, r_spec_name)</pre><br />
It's pretty simple. My question is regarding the linking of the primary keys. Is it necessary to link the primary keys if I were doing something like: The number of journals for which researcher ‘Albert Einstein’ is the chief editor?<br />
<br />
The SQL query I came up with is:<br />
<br />
 <pre style="margin:20px; line-height:13px">SELECT count (*), j.j_num<br />
FROM journals as J, Researchers as R, Area_edits as AE<br />
WHERE J.chief_editor_r_ssn=R.r_ssn<br />
AND R.r_name=&quot;Albert Einstein&quot;<br />
AND R.r_ssn=AE.r_ssn<br />
AND J.j_num=AE.j_num;</pre><br />
Is it necessary to include the last 2 steps, or are the unneeded?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>J3vr0N</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239837.html</guid>
		</item>
		<item>
			<title>please solve this query</title>
			<link>http://www.daniweb.com/forums/thread239787.html</link>
			<pubDate>Thu, 19 Nov 2009 15:39:43 GMT</pubDate>
			<description>create a query that will display total no of employee and no of employee that hired in 1995,96,97 from employee table.. 
 
my employee table have field like 
emp_id name hire_date.</description>
			<content:encoded><![CDATA[<div>create a query that will display total no of employee and no of employee that hired in 1995,96,97 from employee table..<br />
<br />
my employee table have field like<br />
emp_id name hire_date.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jck6288</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239787.html</guid>
		</item>
		<item>
			<title>Mysql Query results with Hyperlink and Font example</title>
			<link>http://www.daniweb.com/forums/thread239779.html</link>
			<pubDate>Thu, 19 Nov 2009 15:22:40 GMT</pubDate>
			<description>Hey, 
 
This is my first post so go easy :) 
 
I’m in the middle of designing a website users can download files from. I’ve searched the web and found the perfect example of what I’m trying to achieve which is something clear and simple (http://www.getfreefonts.info/free_fonts.a.html) 
 
From the...</description>
			<content:encoded><![CDATA[<div>Hey,<br />
<br />
This is my first post so go easy :)<br />
<br />
I’m in the middle of designing a website users can download files from. I’ve searched the web and found the perfect example of what I’m trying to achieve which is something clear and simple (<a rel="nofollow" class="t" href="http://www.getfreefonts.info/free_fonts.a.html" target="_blank">http://www.getfreefonts.info/free_fonts.a.html</a>)<br />
<br />
From the category’s at the top A-Z how, can I return the results with a hyperlink and example of the font? I’m new to web designing (only done 1 before) but I know I need mysql and PhP.<br />
<br />
Regards<br />
Steve</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>StePu</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239779.html</guid>
		</item>
		<item>
			<title>Partitioning</title>
			<link>http://www.daniweb.com/forums/thread239658.html</link>
			<pubDate>Thu, 19 Nov 2009 06:17:08 GMT</pubDate>
			<description><![CDATA[Below is the table and the data related to it .How to do we go ahead and create partitioning for this table .Below table had like 50 million of records. 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a...]]></description>
			<content:encoded><![CDATA[<div>Below is the table and the data related to it .How to do we go ahead and create partitioning for this table .Below table had like 50 million of records.<br />
 <pre style="margin:20px; line-height:13px">CREATE TABLE l_play ( <br />
Pl_id int(11) not null auto increment <br />
E_Id` int(11) NOT NULL, <br />
F_Id` int(11) DEFAULT NULL, <br />
P_Id` int(11) DEFAULT NULL, <br />
P_T` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, <br />
PRIMARY KEY (`pl_id`), <br />
KEY FK_log_playlog_processor` (`Proc_Id`), <br />
KEY FK_log_playlog_file` (`Fi_Id`), <br />
CONSTRAINT FK_log_playlog` FOREIGN KEY (`Fi_Id`) REFERENCESlog_file` (`Fi_Id`), <br />
CONSTRAINT FK_log_playlog_prc` FOREIGN KEY (`Proc_Id`) REFERENCESlog_processor` (`Proc_Id`), <br />
<br />
) ENGINE=InnoDB DEFAULT CHARSET=latin1</pre>Need to partiotion by date .. we get around each day around 1 lakhs of records .. so need to partition for each week or each month .<br />
sample data :<br />
<br />
<br />
102649, 31, 35,, 16, 2008-05-20 05:49:00.0<br />
102650,1, 35, ,7, 2008-05-20 05:50:00.0<br />
102651,2, 35,, 8, 2008-05-20 05:50:00.0<br />
102652,1, 35,, 7, 2008-05-20 05:52:00.0<br />
102653,5, 35,, 9, 2008-05-20 05:53:00.0<br />
102654,1, 35,, 7, 2008-05-20 05:54:00.0<br />
102655,6, 35,, 10, 2008-05-20 05:55:00.0</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>oyeubugme26</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239658.html</guid>
		</item>
		<item>
			<title>What is the best way to store tags in mysql?</title>
			<link>http://www.daniweb.com/forums/thread239580.html</link>
			<pubDate>Wed, 18 Nov 2009 22:30:01 GMT</pubDate>
			<description>Hi 
What is the best way to store tags in mysql database? 
Please help me with this. 
Thanks</description>
			<content:encoded><![CDATA[<div>Hi<br />
What is the best way to store tags in mysql database?<br />
Please help me with this.<br />
Thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>virtualmisc</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239580.html</guid>
		</item>
		<item>
			<title>2 update for 2 table</title>
			<link>http://www.daniweb.com/forums/thread239244.html</link>
			<pubDate>Tue, 17 Nov 2009 17:43:47 GMT</pubDate>
			<description><![CDATA[*this is post table * 
[IMG]http://www.divran.com/script/upload/images/post.jpg[/IMG]  
 
*this is thread table * 
[IMG]http://www.divran.com/script/upload/images/thread.jpg[/IMG]  
 
lie you see 
 
firstpostid in thread table  =  postid in post table  and threadid's]]></description>
			<content:encoded><![CDATA[<div><span style="font-weight:bold"><span style="color:green">this is post table </span></span><br />
<a href="http://www.divran.com/script/upload/images/post.jpg" target="_blank">http://www.divran.com/script/upload/images/post.jpg</a> <br />
<br />
<span style="font-weight:bold"><span style="color:green">this is thread table </span></span><br />
<a href="http://www.divran.com/script/upload/images/thread.jpg" target="_blank">http://www.divran.com/script/upload/images/thread.jpg</a> <br />
<br />
lie you see<br />
<br />
firstpostid in thread table  =  postid in post table  and threadid's<br />
<br />
i wanna update title column in thread table as title in post table <br />
but how ?<br />
<br />
i create following query for trying but i t does not run <br />
<br />
 <pre style="margin:20px; line-height:13px">UPDATE&nbsp; &nbsp; &nbsp; &nbsp;  thread<br />
INNER&nbsp; &nbsp; &nbsp; &nbsp;  JOIN post ON thread.threadid=post.threadid<br />
SET&nbsp; &nbsp; &nbsp; &nbsp;  thread.title=REPLACE(post.title)<br />
WHERE&nbsp; &nbsp; &nbsp; &nbsp;  post.postid=thread.firstpostid</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>zodehala</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239244.html</guid>
		</item>
		<item>
			<title>altering column order</title>
			<link>http://www.daniweb.com/forums/thread239218.html</link>
			<pubDate>Tue, 17 Nov 2009 15:29:04 GMT</pubDate>
			<description><![CDATA[Hello all, 
Is there an easy way to edit the order of my colums in a table? 
Presently, my colums are: cust_num, name, email, location, bday_day, bday_month, bday_year, state 
 
I would like to list the "location" column after "state".  
 
Can anyone offer a simple suggestion. 
 
Thanks in advance....]]></description>
			<content:encoded><![CDATA[<div>Hello all,<br />
Is there an easy way to edit the order of my colums in a table?<br />
Presently, my colums are: cust_num, name, email, location, bday_day, bday_month, bday_year, state<br />
<br />
I would like to list the &quot;location&quot; column after &quot;state&quot;. <br />
<br />
Can anyone offer a simple suggestion.<br />
<br />
Thanks in advance.<br />
C-</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>studioceasar</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239218.html</guid>
		</item>
		<item>
			<title>Auto_increment</title>
			<link>http://www.daniweb.com/forums/thread239109.html</link>
			<pubDate>Tue, 17 Nov 2009 04:25:30 GMT</pubDate>
			<description><![CDATA[I have a table that holds a users id and a cd number, what I would like is to be able to only increment the cd number based the users id not just incrementing it every time a new cd is created 
 
table 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a...]]></description>
			<content:encoded><![CDATA[<div>I have a table that holds a users id and a cd number, what I would like is to be able to only increment the cd number based the users id not just incrementing it every time a new cd is created<br />
<br />
table<br />
 <pre style="margin:20px; line-height:13px">CREATE TABLE IF NOT EXISTS `cdcreation` (<br />
&nbsp; `user_Id` int(3) NOT NULL,<br />
&nbsp; `cd_Number` int(2) NOT NULL,<br />
&nbsp; PRIMARY KEY (`user_Id`,`cd_Number`)<br />
) ENGINE=MyISAM DEFAULT CHARSET=latin1;</pre><br />
user id's start at 100, so if an id is present but no cd user 100 will get cd 1, if user 101 has no cd they get cd 1 as well, when user 100 makes next cd they get cd 2 and when user 102 gets 1st cd they get cd 1, so it increments based on user number and cd number.<br />
<br />
Both cd number and user id will form the primary key, I would also like to be able to max the number of cd's able to be created to 5(this is not critical but a preference) I use AUTO_INCREMENT in other parts of my db but not sure how to implement it this way based on a user id.<br />
<br />
any help much appreciated</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>mr_scooby</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239109.html</guid>
		</item>
		<item>
			<title>Setting up veiws</title>
			<link>http://www.daniweb.com/forums/thread239073.html</link>
			<pubDate>Tue, 17 Nov 2009 00:39:20 GMT</pubDate>
			<description>I am a Student working on  a project useing mysql. I am trying to set up a view and keep getting an error that there is duplicate columns. Is there anyway other then specifiying each table.culumn to stop the view from trying to show both of the columns.  If it helps the two columns are the primary...</description>
			<content:encoded><![CDATA[<div>I am a Student working on  a project useing mysql. I am trying to set up a view and keep getting an error that there is duplicate columns. Is there anyway other then specifiying each table.culumn to stop the view from trying to show both of the columns.  If it helps the two columns are the primary key of one table and the foreign key of another.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>ireverent</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239073.html</guid>
		</item>
		<item>
			<title>I really need help linking tables MYSQL</title>
			<link>http://www.daniweb.com/forums/thread238991.html</link>
			<pubDate>Mon, 16 Nov 2009 17:57:02 GMT</pubDate>
			<description><![CDATA[Hello everyone. 
 
Basically, I am making a small site for my friends where we can create users and edit profiles and comment eachother. 
Like a scaled down social network site. The problem is, I really can't get my head around the whole idea of relational databases. 
 
What I have is a table for...]]></description>
			<content:encoded><![CDATA[<div>Hello everyone.<br />
<br />
Basically, I am making a small site for my friends where we can create users and edit profiles and comment eachother.<br />
Like a scaled down social network site. The problem is, I really can't get my head around the whole idea of relational databases.<br />
<br />
What I have is a table for the users - which stores their username, password etc.<br />
I then want this to link into my profile table, which stores their pictures and page-style information etc.<br />
This could then link into other tables for things like comments or statuses etc.<br />
<br />
I am using MySQL and I thought I could link e.g. the user table to the profile table by having the same id. For example, the user table has a user_id field (primary key) and a profile_id which links into the profile_id (primary key) on the profile table.<br />
But I just don't get how to implement this.<br />
It's really hard to explain. I want it, so that when a user registers - not only does the user_id auto increment, but so does the profile_id in the profiles table. And the pictures information and other information from the profile table can be used by the user table to define who the users are etc.<br />
<br />
Could anyone please lend me a helping hand with this. I will try and explain more clearly if you would like.<br />
<br />
Thank you a lot.<br />
<br />
Josh</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>josh06</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread238991.html</guid>
		</item>
		<item>
			<title>count query</title>
			<link>http://www.daniweb.com/forums/thread238944.html</link>
			<pubDate>Mon, 16 Nov 2009 14:26:46 GMT</pubDate>
			<description>Hi 
 
Been trying to write a query... I have a table of documents, and a table which registers everytime someone downloads a copy of the document.  I want to create a report, in one query, which pulls out each document and counts the views... I thought it woudnt be too tough but have come...</description>
			<content:encoded><![CDATA[<div>Hi<br />
<br />
Been trying to write a query... I have a table of documents, and a table which registers everytime someone downloads a copy of the document.  I want to create a report, in one query, which pulls out each document and counts the views... I thought it woudnt be too tough but have come unstuck...<br />
<br />
 <pre style="margin:20px; line-height:13px">$sql = &quot;SELECT d.title, d.mktime, COUNT(r.id) FROM documents AS d LEFT JOIN clickreg AS r ON r.docid = d.id&quot;</pre><br />
help please!?!<br />
<br />
thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>lifeworks</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread238944.html</guid>
		</item>
		<item>
			<title>Getting Error While Trying to Use Count Function in Subquery in FROM Clause</title>
			<link>http://www.daniweb.com/forums/thread238531.html</link>
			<pubDate>Sat, 14 Nov 2009 19:36:39 GMT</pubDate>
			<description><![CDATA[The below mysql query yeilds the following result: 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags" target="_blank">Help with Code...]]></description>
			<content:encoded><![CDATA[<div>The below mysql query yeilds the following result:<br />
<br />
 <pre style="margin:20px; line-height:13px">SELECT COUNT(ProgramType) AS Counter<br />
FROm credential_state<br />
GROUP BY ProgramType;</pre><br />
Results:<br />
Counter<br />
4<br />
7<br />
7<br />
<br />
I would like return the max from the above (7).  The following query is giving my an error that says: Every derived table must have its own alias. Not sure what I'm doing wrong.<br />
<br />
 <pre style="margin:20px; line-height:13px">SELECT MAX(Counter) AS MAX FROM(SELECT COUNT(ProgramType) AS Counter<br />
FROm credential_state<br />
GROUP BY ProgramType);</pre><br />
Please HELP!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Chad Gary</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread238531.html</guid>
		</item>
		<item>
			<title><![CDATA[Code Snippet SQL Insert India 'State']]></title>
			<link>http://www.daniweb.com/code/snippet238456.html</link>
			<pubDate>Sat, 14 Nov 2009 08:30:27 GMT</pubDate>
			<description>Table 
CREATE TABLE `state` (                                                                     
          `StateID` INT(11) NOT NULL AUTO_INCREMENT,                                               
          `CountryID` INT(11) NOT NULL,                                                            
...</description>
			<content:encoded><![CDATA[<div>Table<br />
CREATE TABLE `state` (                                                                    <br />
          `StateID` INT(11) NOT NULL AUTO_INCREMENT,                                              <br />
          `CountryID` INT(11) NOT NULL,                                                           <br />
          `StateName` VARCHAR(50) NOT NULL,                                                       <br />
          `Notes` LONGTEXT,                                                                       <br />
          `ChangedBy` VARCHAR(50) DEFAULT NULL,                                                   <br />
          `ChangeDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,  <br />
          PRIMARY KEY  (`StateID`)                                                                <br />
        ) ENGINE=INNODB AUTO_INCREMENT=36 DEFAULT CHARSET=latin1<br />
<br />
<br />
Insert<br />
<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','ANDHRA PRADESH',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','ASSAM',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','ARUNACHAL PRADESH',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','GUJRAT',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','BIHAR',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','HARYANA',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','HIMACHAL PRADESH',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','JAMMU &amp; KASHMIR',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','KARNATAKA',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','KERALA',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','MADHYA PRADESH',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','MAHARASHTRA',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','MANIPUR',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','MEGHALAYA',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','MIZORAM',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','NAGALAND',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','ORISSA',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','PUNJAB',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','RAJASTHAN',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','SIKKIM',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','TAMIL NADU',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','TRIPURA',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','UTTAR PRADESH',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','WEST BENGAL',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','DELHI',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','GOA',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','PONDICHERY',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','LAKSHDWEEP',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','DAMAN &amp; DIU',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','DADRA &amp; NAGAR',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','CHANDIGARH',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','ANDAMAN &amp; NICOBAR',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','UTTARANCHAL',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','JHARKHAND',NULL,'Nieanjan',CURRENT_TIMESTAMP);<br />
INSERT INTO `state`(`StateID`,`CountryID`,`StateName`,`Notes`,`ChangedBy`,`ChangeDate`) VALUES ( NULL,'1','CHATTISGARH',NULL,'Nieanjan',CURRENT_TIMESTAMP);</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>niranjanjee</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread238456.html</guid>
		</item>
		<item>
			<title>SQL SELECT question.</title>
			<link>http://www.daniweb.com/forums/thread238314.html</link>
			<pubDate>Fri, 13 Nov 2009 16:19:52 GMT</pubDate>
			<description><![CDATA[Hi, i'm sql newbies, hope someone can help. 
 
I'm trying to do a tariff lookup table for my voip service. When a user makes a call, i capture the destination phone number which has the country code prefix (the prefix may have or not have the plus sign). I'm trying to create a SELECT statement...]]></description>
			<content:encoded><![CDATA[<div>Hi, i'm sql newbies, hope someone can help.<br />
<br />
I'm trying to do a tariff lookup table for my voip service. When a user makes a call, i capture the destination phone number which has the country code prefix (the prefix may have or not have the plus sign). I'm trying to create a SELECT statement which i can use to query the rates table (see structure below) using the country code, and obtain the TARIFF.<br />
<br />
For example, in my rate tables, i've got the tariffs for calls to the US (country code 1 or +1) and to Bahamas (country code +1 242 or 1242).<br />
<br />
So, if a call goes to +1800xxxxxxxxx or 1800xxxxxxxxx, I would have to assume that the call goes to the US which carries a tariff of 1.30 cents. If the calls goes to +1242xxxxxxxxx, I will have to assume that the call goes to the Bahamas which carries a tariff of 1.95 cents.<br />
<br />
I tried the following but they don't work:<br />
<br />
SELECT TARIFF from RATES where 1800xxxxxxxxx like COUNTRYCODE%<br />
Or the other way round:<br />
SELECT TARIFF from RATES where COUNTRYCODE% like 1800xxxxxxxxx<br />
Plus a lot others.<br />
<br />
Would appreciate any pointers. :)<br />
<br />
============================================<br />
<br />
CREATE TABLE `rates` (<br />
`RATESID` int(4) NOT NULL auto_increment,<br />
`COUNTRYNAME` varchar(50) NOT NULL,<br />
`COUNTRYCODE` varchar(3) NOT NULL,<br />
`PREFIXRANGE` varchar(200) default NULL,<br />
`TARIFF` decimal(10,2) NOT NULL default '1.00',<br />
PRIMARY KEY (`RATESID`)<br />
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;<br />
<br />
INSERT INTO `rates` (`RATESID`, `COUNTRYNAME`, `COUNTRYCODE`, `PREFIXRANGE`, `TARIFF`) VALUES<br />
(1, 'UNITED STATES', '1', NULL, '1.30');<br />
<br />
INSERT INTO `rates` (`RATESID`, `COUNTRYNAME`, `COUNTRYCODE`, `PREFIXRANGE`, `TARIFF`) VALUES<br />
(2, 'BAHAMAS', '1242', NULL, '1.95');<br />
<br />
Would I be able to achieve what I want using SQL?  Grateful for any tip.   :)</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>joshua__lim</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread238314.html</guid>
		</item>
		<item>
			<title>Excel and transfer to Mysql</title>
			<link>http://www.daniweb.com/forums/thread238006.html</link>
			<pubDate>Thu, 12 Nov 2009 11:29:55 GMT</pubDate>
			<description>Hello, 
 
New here so hello. 
 
I need to transfer an Excel file to Mysql with a large amount of data. I looked on a few forums but have not found much. Do you know how to do this? Is there an easy solution? 
 
Thanks a lot.</description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
New here so hello.<br />
<br />
I need to transfer an Excel file to Mysql with a large amount of data. I looked on a few forums but have not found much. Do you know how to do this? Is there an easy solution?<br />
<br />
Thanks a lot.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>asmikwen</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread238006.html</guid>
		</item>
		<item>
			<title>How to get the percentage??</title>
			<link>http://www.daniweb.com/forums/thread237946.html</link>
			<pubDate>Thu, 12 Nov 2009 07:31:18 GMT</pubDate>
			<description><![CDATA[I got a query to calculate the percentage as , 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags" target="_blank">Help with Code...]]></description>
			<content:encoded><![CDATA[<div>I got a query to calculate the percentage as ,<br />
<br />
 <pre style="margin:20px; line-height:13px">Select votes, rating, votes/sum(votes) as percentage</pre><br />
But I want to take the values from two different tables. I tried<br />
<br />
 <pre style="margin:20px; line-height:13px"><br />
Select elec.sum(votes) from elec, stat.sum(rating) from stat where year=2009, elec.sum(votes)/tat.sum(rating) as percentage;</pre><br />
This doesn't work.<br />
plz help.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jrosh</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237946.html</guid>
		</item>
		<item>
			<title>About a SELECT command to execute in my MysQL Database</title>
			<link>http://www.daniweb.com/forums/thread237824.html</link>
			<pubDate>Wed, 11 Nov 2009 19:19:15 GMT</pubDate>
			<description><![CDATA[Hello, 
 
I have a MySQL 5.0 Database used for management of my service, with 13 tables. 
 
The two tables most important now are "customers" and "cust_packages". 
 
The table "customers" has one column "cust_email". This column has e-mails of customers of the my service. 
 
The table named...]]></description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
I have a MySQL 5.0 Database used for management of my service, with 13 tables.<br />
<br />
The two tables most important now are &quot;customers&quot; and &quot;cust_packages&quot;.<br />
<br />
The table &quot;customers&quot; has one column &quot;cust_email&quot;. This column has e-mails of customers of the my service.<br />
<br />
The table named &quot;cust_packages&quot; has one column &quot;cpack_canceldate&quot;. This column has the date of canceled accounts, for example '2008-04-03'. If the account is not canceled, so this column has '0000-00-00'.<br />
<br />
Both tables &quot;customers&quot; and &quot;cust_packages&quot; have &quot;cust_custnr&quot; and &quot;cpack_usernr&quot; respectively with interconnected values.<br />
<br />
These columns have an identification number exclusive for each customer.<br />
<br />
For example, I have one customer with the number '110002' in the column &quot;cust_custnr&quot; of the table &quot;customers&quot;. The same number is in the column &quot;cpack_usernr&quot; of the table &quot;cust_packages&quot;.<br />
<br />
I want to select all e-mails of customers with canceled accounts.<br />
<br />
But there is a problem. The same customer may have two accounts...the same number may appear two or more times in the colum &quot;cpack_usernr&quot; of the table &quot;cust_packages&quot;. For example, the customer '110002' in the past cancelled his account, but recently he opened another account.  Because this, the same number 110002 appear two times in the column &quot;cpack_usernr&quot; of the table &quot;cust_packages&quot;. I need only exclusive customers with canceled accounts.<br />
<br />
So, I want to select all e-mails of customers with canceled accounts AND ONLY for customers which appear ONE TIME in the colum &quot;cpack_usernr&quot; of the table &quot;cust_packages&quot;.<br />
<br />
Thanks.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Carcinosi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237824.html</guid>
		</item>
		<item>
			<title>Selection by date</title>
			<link>http://www.daniweb.com/forums/thread237800.html</link>
			<pubDate>Wed, 11 Nov 2009 17:08:34 GMT</pubDate>
			<description><![CDATA[I need to make ten selections. One of all the datetimes in the last 24 hours, the next one from 24 hours to 48 hours, and on back in 24 hour blocks for the last ten days.  I've tried various approaches to this, but this is what I currently have: 
 
  <div class="codeblock"> <div class="spaced">...]]></description>
			<content:encoded><![CDATA[<div>I need to make ten selections. One of all the datetimes in the last 24 hours, the next one from 24 hours to 48 hours, and on back in 24 hour blocks for the last ten days.  I've tried various approaches to this, but this is what I currently have:<br />
<br />
 <pre style="margin:20px; line-height:13px">select title, app_id, count(*) as cnt from app_instances where time between now() -1 day and now()-2 day group by title order by cnt desc</pre><br />
The best way I can think of is to run these queries inside a for loop, substituting out the numbers for incremental variables in PHP to result in 10 seperate selections.  Does anyone know the correct syntax for this or maybe have a better way?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>benkyma</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237800.html</guid>
		</item>
		<item>
			<title>Get ID from table</title>
			<link>http://www.daniweb.com/forums/thread237628.html</link>
			<pubDate>Wed, 11 Nov 2009 02:12:11 GMT</pubDate>
			<description><![CDATA[Hi, 
 
I am trying to get the primary key (which is number) from a field of the same table. however i encountered "Undefined index" shown on my screen.  
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a...]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I am trying to get the primary key (which is number) from a field of the same table. however i encountered &quot;Undefined index&quot; shown on my screen. <br />
<br />
 <pre style="margin:20px; line-height:13px">$orange_insert = &quot;INSERT INTO orange (orange_id, orange_name, orange_add)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  VALUES (NULL, '$val_name', '$val_add')&quot;;<br />
$result = mysql_query($orange_insert) or die (mysql_error());<br />
$orange_sel = &quot;SELECT *<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  FROM orange&quot;;<br />
$result_orgsel = mysql_query($orange_sel) or die (mysql_error()); <br />
$row = mysql_fetch_array($result_orgsel); <br />
<br />
$result_orange = $row['$orange_id'];<br />
<br />
echo $result_orange;</pre><br />
can anyone assist me thru my code if i have done some terrible mistake here. Thank you so much.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>futhonguy</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237628.html</guid>
		</item>
		<item>
			<title>SQL Query</title>
			<link>http://www.daniweb.com/forums/thread237536.html</link>
			<pubDate>Tue, 10 Nov 2009 18:58:24 GMT</pubDate>
			<description><![CDATA[How can I use this query to calculate the max average grade? 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags" target="_blank">Help...]]></description>
			<content:encoded><![CDATA[<div>How can I use this query to calculate the max average grade?<br />
<br />
 <pre style="margin:20px; line-height:13px"> SELECT dname, cno, sectno, avg(grade)<br />
FROM enroll<br />
GROUP BY dname, sectno, cno;</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Samyx</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237536.html</guid>
		</item>
		<item>
			<title>Link data website to Access</title>
			<link>http://www.daniweb.com/forums/thread237490.html</link>
			<pubDate>Tue, 10 Nov 2009 14:38:15 GMT</pubDate>
			<description><![CDATA[Is there a simple way to link up a data website to my newly created Access program? I need specific information to fill in the tables, and currently I am manually entering the info in from the site; it would be much easier to have this website post it for me. I'm new to programming and could use a...]]></description>
			<content:encoded><![CDATA[<div>Is there a simple way to link up a data website to my newly created Access program? I need specific information to fill in the tables, and currently I am manually entering the info in from the site; it would be much easier to have this website post it for me. I'm new to programming and could use a hint as to how this is done. This is a weather program I use to determine sales, such as High, Mean, Low temp, precip, wind, etc...</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Horizon1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237490.html</guid>
		</item>
		<item>
			<title>Stored Procedures to insert into a table</title>
			<link>http://www.daniweb.com/forums/thread237431.html</link>
			<pubDate>Tue, 10 Nov 2009 09:09:59 GMT</pubDate>
			<description>Post moved</description>
			<content:encoded><![CDATA[<div>Post moved</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>wchitamb</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237431.html</guid>
		</item>
		<item>
			<title>mysql file created in php</title>
			<link>http://www.daniweb.com/forums/thread237140.html</link>
			<pubDate>Mon, 09 Nov 2009 06:08:56 GMT</pubDate>
			<description><![CDATA[i have a project that implements the using of database. i chose to use php as the application interface and mysql as the database. 
 
at the end of this month, we should submit the softcopy. now, i'm confused with the files of my project. 
i'm using wamp server, and in folder www there are php and...]]></description>
			<content:encoded><![CDATA[<div>i have a project that implements the using of database. i chose to use php as the application interface and mysql as the database.<br />
<br />
at the end of this month, we should submit the softcopy. now, i'm confused with the files of my project.<br />
i'm using wamp server, and in folder www there are php and html files. but, i don't know which file is the database file. as far as i know, the database is the file with .db extension. but, i can't find it.<br />
<br />
does anyone know which file is the database?<br />
thx so much.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>AirGear</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237140.html</guid>
		</item>
		<item>
			<title>problem with wamp</title>
			<link>http://www.daniweb.com/forums/thread237119.html</link>
			<pubDate>Mon, 09 Nov 2009 04:19:59 GMT</pubDate>
			<description><![CDATA[I set a password to mysql console in wamp. I followed a video tutorial. 
And it was successful. 
But now I can't access phpmyadmin or localhost.  
It says invalid password ...And gives no option to type the password. 
 
How can I solve this??]]></description>
			<content:encoded><![CDATA[<div>I set a password to mysql console in wamp. I followed a video tutorial.<br />
And it was successful.<br />
But now I can't access phpmyadmin or localhost. <br />
It says invalid password ...And gives no option to type the password.<br />
<br />
How can I solve this??</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jrosh</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237119.html</guid>
		</item>
		<item>
			<title><![CDATA[creating files with 'outfile'??]]></title>
			<link>http://www.daniweb.com/forums/thread237118.html</link>
			<pubDate>Mon, 09 Nov 2009 04:16:06 GMT</pubDate>
			<description><![CDATA[I created some data files with 'outfile ' command. 
 
The files are created in the mysql folder.{I use WAMP} 
I want to create those files in another directory. 
 
How can I do that? 
 
Thankx in advance.]]></description>
			<content:encoded><![CDATA[<div>I created some data files with 'outfile ' command.<br />
<br />
The files are created in the mysql folder.{I use WAMP}<br />
I want to create those files in another directory.<br />
<br />
How can I do that?<br />
<br />
Thankx in advance.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jrosh</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237118.html</guid>
		</item>
		<item>
			<title>Universal character set?</title>
			<link>http://www.daniweb.com/forums/thread236543.html</link>
			<pubDate>Fri, 06 Nov 2009 10:48:03 GMT</pubDate>
			<description>I have a database that needs to hold names of people from all around the world. Some names have special characters in them such as é and ¢ 
 
Is there a character set I can use that will accept any character no matter what language it is (with the exception of non-English looking characters like...</description>
			<content:encoded><![CDATA[<div>I have a database that needs to hold names of people from all around the world. Some names have special characters in them such as é and ¢<br />
<br />
Is there a character set I can use that will accept any character no matter what language it is (with the exception of non-English looking characters like chinese characters for instance)</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Venom Rush</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236543.html</guid>
		</item>
		<item>
			<title>.sql file loses characters</title>
			<link>http://www.daniweb.com/forums/thread236299.html</link>
			<pubDate>Thu, 05 Nov 2009 15:13:22 GMT</pubDate>
			<description><![CDATA[Hello 
New member and pretty ignorant about SQL I should say. 
I have made regular backups of mySQL database and now that I need to restore it* I see all the characters (UTF-8) characters have changed to wierd characters *that make no sense at all.   
I am using *phpMyAdmin's Export tool *which...]]></description>
			<content:encoded><![CDATA[<div>Hello<br />
New member and pretty ignorant about SQL I should say.<br />
I have made regular backups of mySQL database and now that I need to restore it<span style="font-weight:bold"> I see all the characters (UTF-8) characters have changed to wierd characters </span>that make no sense at all.  <br />
I am using <span style="font-weight:bold">phpMyAdmin's Export tool </span>which generates a .sql file.  But I see no option while saving this file to select UTF-8 or ASCII.<br />
<br />
<span style="font-weight:bold"><span style="color:Green"><span style="color:green">2 questions:<br />
1. HOw can I restore my backup file into proper characers?<br />
2.what can I do in future to avoid this problem and save the .sql file as UTF-8.</span></span></span><br />
Greatly appreciate your attention<br />
L</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Logical1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236299.html</guid>
		</item>
		<item>
			<title>exclude</title>
			<link>http://www.daniweb.com/forums/thread236270.html</link>
			<pubDate>Thu, 05 Nov 2009 13:18:11 GMT</pubDate>
			<description><![CDATA[hi 
 
i have two tables, one is products, the other is for 'discounts' on those products... when adding a new 'discount' i want to avoid adding two discounts to a single product... so i was looking for some sort of Right Join which would exclude all products which have a match in the discount...]]></description>
			<content:encoded><![CDATA[<div>hi<br />
<br />
i have two tables, one is products, the other is for 'discounts' on those products... when adding a new 'discount' i want to avoid adding two discounts to a single product... so i was looking for some sort of Right Join which would exclude all products which have a match in the discount table?!<br />
<br />
Ill be using a 'select' to choose a product to add a discount to... the query needs to output all product name without a corresponding discount entry...<br />
<br />
any ideas?<br />
<br />
lworks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>lifeworks</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236270.html</guid>
		</item>
		<item>
			<title>What does mysql return when the selection doesnt exist?</title>
			<link>http://www.daniweb.com/forums/thread236046.html</link>
			<pubDate>Wed, 04 Nov 2009 19:51:03 GMT</pubDate>
			<description><![CDATA[Ok so what does mysql return when the select query doesnt exist. So say I query the database: SELECT username FROM user WHERE username='test' AND password='test' 
 
Ok so say test doesnt exist what will the database return because i code in java and have made a method that should return true or...]]></description>
			<content:encoded><![CDATA[<div>Ok so what does mysql return when the select query doesnt exist. So say I query the database: SELECT username FROM user WHERE username='test' AND password='test'<br />
<br />
Ok so say test doesnt exist what will the database return because i code in java and have made a method that should return true or false. True if the the thing exists in the query and false if it doesnt. But for some reason it always returns true. It turns out because mysql returns something each time.<br />
<br />
Thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jakx12</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236046.html</guid>
		</item>
		<item>
			<title>how to get back my database with damaged wamp server??</title>
			<link>http://www.daniweb.com/forums/thread235883.html</link>
			<pubDate>Wed, 04 Nov 2009 07:40:26 GMT</pubDate>
			<description><![CDATA["My wamp server got damaged recently and i had no backup for my databases. I had reinstalled the wamp server and replaced the bin/mysql/data folder to the new one but I only get the database and not the tables inside it. I need help!!!!!!!! ";]]></description>
			<content:encoded><![CDATA[<div> <pre style="margin:20px; line-height:13px">&quot;My wamp server got damaged recently and i had no backup for my databases. I had reinstalled the wamp server and replaced the bin/mysql/data folder to the new one but I only get the database and not the tables inside it. I need help!!!!!!!! &quot;;</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>sfsrocky</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235883.html</guid>
		</item>
		<item>
			<title>Remove last chars</title>
			<link>http://www.daniweb.com/forums/thread235757.html</link>
			<pubDate>Tue, 03 Nov 2009 20:40:37 GMT</pubDate>
			<description><![CDATA[Hello all, i would like to know how it is possible to remove for example last 20 characters, or by specifing the string to remove. 
For example i have 2 rows (in reality there are more than 100, thats why im not working it out by hand) with the next content: 
insert into abc (1,"hello...]]></description>
			<content:encoded><![CDATA[<div>Hello all, i would like to know how it is possible to remove for example last 20 characters, or by specifing the string to remove.<br />
For example i have 2 rows (in reality there are more than 100, thats why im not working it out by hand) with the next content:<br />
insert into abc (1,&quot;hello &lt;b&gt;b&lt;/b&gt;lol&quot;);<br />
insert into abc(2,&quot;bye &lt;b&gt;a&lt;/b&gt;lol&quot;);<br />
i would like to remove 3 last characters or the string &quot;lol&quot;.<br />
Thanks in advance.<br />
Have a good day.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jen140</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235757.html</guid>
		</item>
		<item>
			<title>How to store a big database</title>
			<link>http://www.daniweb.com/forums/thread235639.html</link>
			<pubDate>Tue, 03 Nov 2009 11:38:18 GMT</pubDate>
			<description><![CDATA[Hi and I have been working on a project involving a rather large database. My question is "For a database with over 20529860 rows, is it better to have 3330 tables spreaded equally or to split into multiple databases or would it be better to have 49950 tables in the database containing the...]]></description>
			<content:encoded><![CDATA[<div>Hi and I have been working on a project involving a rather large database. My question is &quot;For a database with over 20529860 rows, is it better to have 3330 tables spreaded equally or to split into multiple databases or would it be better to have 49950 tables in the database containing the information?&quot; The reason I ask is that having all those rows in the one table makes it really slow with the Where clause and I'm not sure which way is the best way to design this database with mysql. I found that anything over 15MB in one table takes too long to lookup so if I had to guess I would spread it over the 49950 tables ((255-33)*15*15) but sounds like a ridiculous number of tables to store the one set of data. <span style="font-weight:bold">So does anybody have any ideas on how to store potentially 1,000,000,000 rows in mysql.</span> Each row only contains a few bytes. Thanks.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>cwarn23</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235639.html</guid>
		</item>
		<item>
			<title>SQL statement for easier db a search</title>
			<link>http://www.daniweb.com/forums/thread235346.html</link>
			<pubDate>Mon, 02 Nov 2009 13:04:12 GMT</pubDate>
			<description>Hi. 
I have a web application whereby I perform  a search through 4 fields, namely:book serial no.,tel no.,gender and publishing date.In my jsp page variables picking the values respectively are:serial,tel,gender and datez.These are submitted to the java class.Currently, I perform my searches as...</description>
			<content:encoded><![CDATA[<div>Hi.<br />
I have a web application whereby I perform  a search through 4 fields, namely:book serial no.,tel no.,gender and publishing date.In my jsp page variables picking the values respectively are:serial,tel,gender and datez.These are submitted to the java class.Currently, I perform my searches as follows(in java class):<br />
/***********************************************/<br />
 <pre style="margin:20px; line-height:13px">//......after connecting to db and all that<br />
<br />
<br />
if(serial.equals(&quot;&quot;) )<br />
&nbsp;{<br />
&nbsp;if(!tel.equals(&quot;&quot;) )//<br />
&nbsp;{<br />
&nbsp; &nbsp; query = &quot;SELECT * FROM tbooks WHERE tbooks.tel=' &quot;+tel+&quot; ' &quot;;<br />
&nbsp;}<br />
&nbsp; else if(gender.equals(&quot;&quot;))<br />
&nbsp;{<br />
&nbsp;  query = &quot;SELECT * FROM tbooks WHERE tbooks.gender=' &quot;+gender+&quot; ' &quot;;<br />
&nbsp;}<br />
&nbsp; &nbsp; &nbsp; }//end if<br />
else if (!serial.equals(&quot;&quot;))<br />
{<br />
query = &quot;SELECT * FROM tbooks WHERE tbooks.serial=' &quot;+serial+&quot; ' &quot;;<br />
}<br />
<br />
//query is the statement to be executed later as&nbsp; <br />
//ResultSet rs = statement.executeQuery(query);<br />
// more code goes here.......</pre>/********************************************/<br />
The main question here is, Is there an SQL statement that works well in place of my nested if statements? (i.e if serial no is present ,tel is absent, gender is present and date is absent, then it brings results considering the present values only)....Kind of bringing results of .. <pre style="margin:20px; line-height:13px">SELECT * FROM tbooks WHERE serial = ' &quot;+serial+&quot; ' AND tel= ' &quot;+tel+&quot; ' AND gender= ' &quot;+gender+&quot; ' AND datez= ' &quot;+datez+&quot; '</pre>....even if one variable is null it considers only the non-empty variables.Thank you so much in advance.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>dangari</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235346.html</guid>
		</item>
		<item>
			<title>SET datatype</title>
			<link>http://www.daniweb.com/forums/thread235319.html</link>
			<pubDate>Mon, 02 Nov 2009 10:45:47 GMT</pubDate>
			<description>hey.. 
 
i have a table with one column defined as SET 
somethin like (a,b,c) 
 
does anybody know the sql query to be run inorder to get elements like 
a 
b 
c  
all seperately so as to save it in an array in php script..??</description>
			<content:encoded><![CDATA[<div>hey..<br />
<br />
i have a table with one column defined as SET<br />
somethin like (a,b,c)<br />
<br />
does anybody know the sql query to be run inorder to get elements like<br />
a<br />
b<br />
c <br />
all seperately so as to save it in an array in php script..??</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jyotidagia</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235319.html</guid>
		</item>
		<item>
			<title>Stored Procedures Help please</title>
			<link>http://www.daniweb.com/forums/thread235024.html</link>
			<pubDate>Sun, 01 Nov 2009 06:12:57 GMT</pubDate>
			<description>I have made stored procedures in Oracle...but need to export them to mysql. I have searched on google but cant figure out the syntax. 
 
Here is the oracle procedure: 
 
 
create or replace procedure delgroup 
(g_id in number) 
 
is</description>
			<content:encoded><![CDATA[<div>I have made stored procedures in Oracle...but need to export them to mysql. I have searched on google but cant figure out the syntax.<br />
<br />
Here is the oracle procedure:<br />
<br />
<br />
 <pre style="margin:20px; line-height:13px">create or replace procedure delgroup<br />
(g_id in number)<br />
<br />
is<br />
<br />
begin<br />
<br />
DELETE FROM grouptable WHERE GROUP_ID=g_id;<br />
<br />
commit;<br />
end;</pre><br />
<br />
I jus basically want to delete the group from the group table..depending on which group id (the arguement) the user types in.<br />
<br />
How would i do this exact same procedure in mysql?<br />
<br />
Please some assistance guys :)</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>badmanmc</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235024.html</guid>
		</item>
		<item>
			<title>php mysql</title>
			<link>http://www.daniweb.com/forums/thread234662.html</link>
			<pubDate>Fri, 30 Oct 2009 10:52:05 GMT</pubDate>
			<description><![CDATA[could someone point out the error in the followin php/mysql code 
 
$strSearchVal = $_GET['q']; 
//database connection.. 
//... 
 
$strSQL = "SELECT DISTINCT area FROM hospital where area like '%'+ $strSearchVal; "; 
$result = mysql_query($strSQL); 
 
while ($arrThisRow = mysql_fetch_array($result...]]></description>
			<content:encoded><![CDATA[<div>could someone point out the error in the followin php/mysql code<br />
<br />
 <pre style="margin:20px; line-height:13px">$strSearchVal = $_GET&#91;'q'&#93;;<br />
//database connection..<br />
//...<br />
<br />
$strSQL = &quot;SELECT DISTINCT area FROM hospital where area like '%'+ $strSearchVal; &quot;;<br />
$result = mysql_query($strSQL);<br />
<br />
while ($arrThisRow = mysql_fetch_array($result )) {<br />
&nbsp;echo '&lt;li&gt;' . $arrThisRow&#91;'area'&#93; . '&lt;/li&gt;';</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jyotidagia</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234662.html</guid>
		</item>
		<item>
			<title>MySQL Query - Searching for multiple keywords</title>
			<link>http://www.daniweb.com/forums/thread234601.html</link>
			<pubDate>Fri, 30 Oct 2009 05:52:01 GMT</pubDate>
			<description>Hello, 
 
I have a two tables created to apply keywords to a given entry: 
 
Table:  File 
FileID (int, pk, auto incr) 
Name (varchar) 
 
Table File_Keyword 
KeywordID (int, pk, auto incr)</description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
I have a two tables created to apply keywords to a given entry:<br />
<br />
Table:  File<br />
FileID (int, pk, auto incr)<br />
Name (varchar)<br />
<br />
Table File_Keyword<br />
KeywordID (int, pk, auto incr)<br />
FileID (fk)<br />
Keyword (varchar)<br />
<br />
<br />
Given that I have a record in table File with 2 corresponding records in table File_Keyword assigning keywords &quot;ABC&quot; and &quot;XYZ&quot; to the given FileID.<br />
<br />
What is a simple sql query to only return results if both strings are matched:<br />
<br />
 <pre style="margin:20px; line-height:13px">SELECT file.FileID WHERE file.FileID=file_keyword.FileID AND (file_keyword.Keyword LIKE '%ABC%' AND file_keyword.Keyword LIKE '%XYZ%');</pre><br />
<br />
Any assistance would be appreciated.<br />
<br />
Thank you in advance.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>aptitudedude</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234601.html</guid>
		</item>
		<item>
			<title>foreach tutorial</title>
			<link>http://www.daniweb.com/forums/thread234523.html</link>
			<pubDate>Thu, 29 Oct 2009 20:39:18 GMT</pubDate>
			<description><![CDATA[I have be struggling to turn the below while loop into a foreach loop with no result, so I am asking for help here on how to do this. 
   <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a...]]></description>
			<content:encoded><![CDATA[<div>I have be struggling to turn the below while loop into a foreach loop with no result, so I am asking for help here on how to do this.<br />
  <pre style="margin:20px; line-height:13px">$query = &quot;Select * from TIME_TABLE Where<br />
Extract(month from DATE_FIELD ) = DATE_FORMAT(NOW(), '%c')<br />
and<br />
Extract(day from DATE_FIELD ) = DATE_FORMAT(NOW(), '%e')<br />
order by DATE_FIELD, DESCRIPTION&quot;;<br />
$result = $mysqli-&gt;query($query);<br />
<br />
while ($row = $result-&gt;fetch_array(MYSQLI_ASSOC)) {<br />
&nbsp; &nbsp; $dbItems .=&nbsp; &quot;&lt;item&gt; &lt;record_num&gt;&quot; . $row['RECORD_NUM'] . &quot;&lt;/record_num&gt;&quot; .<br />
&nbsp; &nbsp; &nbsp; &nbsp; &quot;&lt;date_field&gt;&quot; .&nbsp;  $row['DATE_FIELD'] . &quot;&lt;/date_field&gt;&quot; .<br />
&nbsp; &nbsp; &nbsp; &nbsp; &quot;&lt;description&gt;&quot; .&nbsp; $row['DESCRIPTION'] . &quot;&lt;/description&gt; &lt;/item&gt;&quot;;<br />
}</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>rouse</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234523.html</guid>
		</item>
		<item>
			<title>SQL to return two of each value from table?</title>
			<link>http://www.daniweb.com/forums/thread234440.html</link>
			<pubDate>Thu, 29 Oct 2009 14:20:11 GMT</pubDate>
			<description><![CDATA[Hi everyone, 
 
I sat down to create a what I thought was simple SQL query but once I got thinking about it I realised I'm not sure where to start. 
 
The objective is to return two resorts from a Resorts table for each country code in that table.  
 
Countries table - Lists all countries 
Resorts...]]></description>
			<content:encoded><![CDATA[<div>Hi everyone,<br />
<br />
I sat down to create a what I thought was simple SQL query but once I got thinking about it I realised I'm not sure where to start.<br />
<br />
The objective is to return two resorts from a Resorts table for each country code in that table. <br />
<br />
Countries table - Lists all countries<br />
Resorts table - Lists resorts and what country code they have which links them to the Countries table.<br />
<br />
I've included a screenshot of what data is in the Resorts table. Basically I just need the two resort names from each country code. The other data can be ignored as it's just airport codes etc.<br />
 <br />
<br />
Any ideas to help me out?<br />
<br />
Many thanks for any help!</div>  <br /> <div style="padding:5px">    <fieldset class="fieldset"> <legend>Attached Images</legend> <table cellpadding="0" cellspacing="5" border="0"> <tr> <td><img class="inlineimg" src="http://www.daniweb.com/forums/images/attach/png.gif" alt="File Type: png" width="16" height="16" border="0" style="vertical-align:baseline" /></td> <td><a href="http://www.daniweb.com/forums/attachment.php?attachmentid=12367&amp;d=1256825864" target="_blank">Picture 1.png</a> (25.8 KB)</td> </tr> </table> </fieldset>   </div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>rickya100</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234440.html</guid>
		</item>
		<item>
			<title>Warning Code : 1265</title>
			<link>http://www.daniweb.com/forums/thread234131.html</link>
			<pubDate>Wed, 28 Oct 2009 16:11:41 GMT</pubDate>
			<description><![CDATA[I am receiving MySQL error 1265 when I try to insert records into a table and after googling this error I am no closer to understanding the problem. 
Here is the error message that is returned: 
Warning Code : 1265 
Data truncated for column 'DATE_FIELD' at row 1 
 
Here is the table definition: 
 ...]]></description>
			<content:encoded><![CDATA[<div>I am receiving MySQL error 1265 when I try to insert records into a table and after googling this error I am no closer to understanding the problem.<br />
Here is the error message that is returned:<br />
Warning Code : 1265<br />
Data truncated for column 'DATE_FIELD' at row 1<br />
<br />
Here is the table definition:<br />
 <pre style="margin:20px; line-height:13px">CREATE TABLE&nbsp; `test`.`TIME_TABLE` (<br />
`RECORD_NUM` INT( 6 ) NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT&nbsp; 'Number of Records',<br />
`DATE_FIELD` DATE NOT NULL COMMENT&nbsp; 'Date of the event',<br />
`DESCRIPTION` VARCHAR( 1000 ) NOT NULL COMMENT&nbsp; 'Detail of the event'<br />
) ENGINE = MYISAM COMMENT =&nbsp; 'This day in history'<br />
<br />
Here is a typical insert:</pre>  <pre style="margin:20px; line-height:13px">INSERT INTO TIME_TABLE ( DATE_FIELD, DESCRIPTION ) VALUES ('28, October&nbsp; &nbsp; 1971' , 'Great Britain launched Prospero, the first of four X-3 satellites.');</pre><br />
When inspecting the table the DATE-FIELD is set to ‘0000-00-00’</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>rouse</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234131.html</guid>
		</item>
		<item>
			<title>Problems restoring mysql database backups</title>
			<link>http://www.daniweb.com/forums/thread234061.html</link>
			<pubDate>Wed, 28 Oct 2009 06:33:31 GMT</pubDate>
			<description><![CDATA[Hi, 
 
I tried to restore my decompressed database *'cyberview_db_2809_2009-10-27_17h30m.Tuesday.sql'* 
 
using the command : 
 
 
---Quote--- 
mysql -h localhost -u root -proot123 info < /backups/daily/cyberview_db_2809/cyberview_db_2809_2009-10-27_17h30m.Tuesday.sql 
---End Quote---]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I tried to restore my decompressed database <span style="font-weight:bold">'cyberview_db_2809_2009-10-27_17h30m.Tuesday.sql'</span><br />
<br />
using the command :<br />
<br />
<div style="margin:20px; margin-top:5px; "> <div class="smallfont" style="margin-bottom:2px">Quote:</div> <table cellpadding="5" cellspacing="0" border="0" width="100%"> <tr> <td class="alt2"> <hr />  mysql -h localhost -u root -proot123 info &lt; /backups/daily/cyberview_db_2809/cyberview_db_2809_2009-10-27_17h30m.Tuesday.sql  <hr /> </td> </tr> </table> </div>but there was no restoration.<br />
<br />
I checked the <span style="font-weight:bold">/var/lib/mysql</span> directory where all restored databases are located, and in the 'info' folder, the only script that was available was 'db.opt'. Nothing else was created.<br />
<br />
Why is this? Pls help.<br />
<br />
Tqs.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Aigini</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234061.html</guid>
		</item>
		<item>
			<title>problem with wamp...</title>
			<link>http://www.daniweb.com/forums/thread234031.html</link>
			<pubDate>Wed, 28 Oct 2009 03:25:56 GMT</pubDate>
			<description><![CDATA[I installed WAMP5 1.7.0  
When I try to access localhost & phpmyadmin, it asks for a username and password.  
I'm pretty sure that  i didn't configured any. 
I  installed the same thing in another computer, and it worked. 
what could be the problem?]]></description>
			<content:encoded><![CDATA[<div>I installed WAMP5 1.7.0 <br />
When I try to access localhost &amp; phpmyadmin, it asks for a username and password. <br />
I'm pretty sure that  i didn't configured any.<br />
I  installed the same thing in another computer, and it worked.<br />
what could be the problem?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jrosh</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234031.html</guid>
		</item>
		<item>
			<title>how do i get started with MySQL</title>
			<link>http://www.daniweb.com/forums/thread233931.html</link>
			<pubDate>Tue, 27 Oct 2009 17:33:28 GMT</pubDate>
			<description>how do i get started with MySQL and get the command prompt like MySQL monitor to write the command for creating a database in MySQL?</description>
			<content:encoded><![CDATA[<div>how do i get started with MySQL and get the command prompt like MySQL monitor to write the command for creating a database in MySQL?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>romilc</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233931.html</guid>
		</item>
		<item>
			<title>News Story Amazon: New, Improved Cloud, Now With MySQL</title>
			<link>http://www.daniweb.com/news/story233896.html</link>
			<pubDate>Tue, 27 Oct 2009 15:08:11 GMT</pubDate>
			<description><![CDATA[At the risk of coming off like TV's "Mad Men (http://www.amctv.com/originals/madmen/)," Amazon Web Services really are New and Improved. The company today announced the addition of Amazon Relational Database Service (http://aws.amazon.com/rds/), giving users of Amazon's Elastic Compute Cloud (EC2)...]]></description>
			<content:encoded><![CDATA[<div>At the risk of coming off like TV's &quot;<a rel="nofollow" class="t" href="http://www.amctv.com/originals/madmen/" target="_blank">Mad Men</a>,&quot; Amazon Web Services really are New and Improved. The company today announced the addition of <a rel="nofollow" class="t" href="http://aws.amazon.com/rds/" target="_blank">Amazon Relational Database Service</a>, giving users of Amazon's Elastic Compute Cloud (EC2) access to a virtual instance of MySQL. That's the New part. Improvements include a family of high-memory instances and a price reduction of Linux-based EC2 compute time to 8.5 cents per hour from 10 cents. The 15 percent price drop takes effect Nov. 1.<br />
<br />
&quot;Many customers have told us that their applications require a relational database,&quot; said Adam Selipsky, vice president of <a rel="nofollow" class="t" href="http://aws.amazon.com/what-is-aws/" target="_blank">Amazon Web Services</a>, in a <a rel="nofollow" class="t" href="http://phx.corporate-ir.net/phoenix.zhtml?c=176060&amp;p=irol-newsArticle&amp;ID=1346525&amp;highlight=" target="_blank">statement</a>. &quot;That’s why we built <a rel="nofollow" class="t" href="http://aws.amazon.com/rds/" target="_blank">Amazon RDS</a>, which combines a familiar relational database with automated management and the instant scalability of the AWS cloud.&quot; Existing MySQL applications can be &quot;work seamlessly with Amazon RDS,&quot; according to claims, while the cloud automates common administrative tasks such as setup and provisioning, patch management and data backups, which are stored for a user-definable period. Database scaling--such as adding add more storage or changing to a larger or smaller DB Instance class-- can be executed with a single API call, the company said. Developers retain control of schema, indices and controls for performance tuning.<br />
<br />
For less complex database needs, Amazon also offers <a rel="nofollow" class="t" href="http://aws.amazon.com/simpledb/" target="_blank">SimpleDB</a>, with which applications can store and retrieve data using simple Web services requests. As with Amazon RDS, provisioning and maintenance are automatic, as are data indexing and backup. Amazon also provides &quot;geo-redundant replicas of the data,&quot; which keeps data available and helps improve performance. Scaling also is automated, the company said, as the cloud responds to changes in database traffic, and schema changes can be accomplished without changes to database code.<br />
<br />
Amazon charges no up-front fees for <a rel="nofollow" class="t" href="http://aws.amazon.com/" target="_blank">its Web services</a>; you pay only for the resources you use.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>EddieC</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233896.html</guid>
		</item>
		<item>
			<title>way to set a mysql status column</title>
			<link>http://www.daniweb.com/forums/thread233844.html</link>
			<pubDate>Tue, 27 Oct 2009 12:08:34 GMT</pubDate>
			<description>Hi there, 
 
I have 2 columns in my mysql table, (1) Status (2) Type. 
 
For the status column I would like to have one row with a STATUS of 1 (live).  And all the rest to have a STATUS of 0 (hidden). 
 
Is there a way to change a row to live and have the other one revert back to 0 in the same SQL...</description>
			<content:encoded><![CDATA[<div>Hi there,<br />
<br />
I have 2 columns in my mysql table, (1) Status (2) Type.<br />
<br />
For the status column I would like to have one row with a STATUS of 1 (live).  And all the rest to have a STATUS of 0 (hidden).<br />
<br />
Is there a way to change a row to live and have the other one revert back to 0 in the same SQL statement?  I only want to have one row active at a time.<br />
<br />
Also, I have 2 options to specify for TYPE column, would I be best to use enum for this column and how would a specify the correct syntax?<br />
<br />
My mysql knowledge is only basic.  Any help would be appreciated.<br />
<br />
Thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>shaneog</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233844.html</guid>
		</item>
		<item>
			<title>Lots of questions about mysql</title>
			<link>http://www.daniweb.com/forums/thread233439.html</link>
			<pubDate>Mon, 26 Oct 2009 11:37:23 GMT</pubDate>
			<description>1. What types of data does the DBMS support? 
2. Does it support NULLS? 
3. What about Primary and Foreign Keys? 
4.Can you specify an index that is unique and then have the system enforce that? 
5. Does the DBMS support views? 
 
6. What type of data dictionary does the DBMS provide - is it...</description>
			<content:encoded><![CDATA[<div>1. What types of data does the DBMS support?<br />
2. Does it support NULLS?<br />
3. What about Primary and Foreign Keys?<br />
4.Can you specify an index that is unique and then have the system enforce that?<br />
5. Does the DBMS support views?<br />
<br />
6. What type of data dictionary does the DBMS provide - is it independent or integrated, in its association to a DBMS?<br />
7. Is it a simple catalog or is it more sophisticated with information about the types of programs that can access it?<br />
8. is it integrated with the non-procedural language?<br />
<br />
9. Does the DBMS support concurrent update (more than one user updating the database)?<br />
10. What is the unit that can be locked (field, row, table, etc.)?<br />
11.Are locks exclusive or shared? (Shared locks allow other users to read the data: with an exclusive lock, no other user can access the data in any way).<br />
12.Does the DBMS resolve deadlocks or must the programs do this?<br />
<br />
13.Does the database support replication?<br />
14.If so, does the DBMS allow partial replicas (copies of only selected rows and fields from tables), and how does the DBMS handle updates from two or more replicas?<br />
15.Can the DBMS distribute a database? (Divide into segments split over more than one sever).<br />
16. Does the DBMS provide procedural support for distributed databases?<br />
<br />
17.What limitations exist with respect to the number of tables, fields and rows per tables?<br />
18. How many files can be open at the same time? (In some DBMS's, each table and index is considered to be a separate file. Thus, a single table with three indexes, all in use at the same time, would account for four files).<br />
19. What type of operating system and hardware is supported?<br />
20. What types of LAN's can you use? (In a LAN, concurrent update is critical as many users may be updating the database at the same time).<br />
<br />
20.How well does the DBMS perform, where performance is a measure of how rapidly the DBMS completes it's tasks? <br />
21.Does the organisation have internal benchmarking standards to be met?<br />
22. Does the DBMS provide a performance monitor to measure the different types of performance whilst the DBMS is running?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>MuffinKun</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233439.html</guid>
		</item>
		<item>
			<title>mySQL permissions ... a few newbie questions</title>
			<link>http://www.daniweb.com/forums/thread233075.html</link>
			<pubDate>Sun, 25 Oct 2009 05:13:18 GMT</pubDate>
			<description><![CDATA[I haven't used the mySQL permissions mechanism to any great degree & could use a little help while still at the design stage. 
 
Is it possible to grant certain users access only to certain RECORDS within a table (based on the value of a field in those records). 
 
If not, I guess I have to use...]]></description>
			<content:encoded><![CDATA[<div>I haven't used the mySQL permissions mechanism to any great degree &amp; could use a little help while still at the design stage.<br />
<br />
Is it possible to grant certain users access only to certain RECORDS within a table (based on the value of a field in those records).<br />
<br />
If not, I guess I have to use separate tables or views for each user.<br />
<br />
Some initial guidance or links to reference material would be greatly appreciated.  TIA<br />
<br />
Edit: I am reading the manuals BTW - <a rel="nofollow" class="t" href="http://dev.mysql.com/doc/#manual" target="_blank">http://dev.mysql.com/doc/#manual</a></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>haggis-man</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233075.html</guid>
		</item>
		<item>
			<title>Special chars in Insert query...</title>
			<link>http://www.daniweb.com/forums/thread233042.html</link>
			<pubDate>Sun, 25 Oct 2009 02:38:08 GMT</pubDate>
			<description><![CDATA[Hello guys, how can to make correct query if in the typed values have a special chars (e.g. ' ") ? 
 
If the typed values have a one special char I know how to make the correct query, but if it have more then one special chars then I don't know how to make the correct query... can someone help me ?...]]></description>
			<content:encoded><![CDATA[<div>Hello guys, how can to make correct query if in the typed values have a special chars (e.g. ' &quot;) ?<br />
<br />
If the typed values have a one special char I know how to make the correct query, but if it have more then one special chars then I don't know how to make the correct query... can someone help me ?<br />
<br />
Thanks.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Krstevski</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233042.html</guid>
		</item>
		<item>
			<title>Query optimization</title>
			<link>http://www.daniweb.com/forums/thread232856.html</link>
			<pubDate>Sat, 24 Oct 2009 10:04:45 GMT</pubDate>
			<description><![CDATA[Hi all. 
I am writing a utility to manage virtual users on a mailserver w/ mysql backed. Unfortunately I am having performance issues when querying for the user's last access date/time. 
 
DB has this structure 
 
table *users* 
  <div class="codeblock"> <div class="spaced"> <div...]]></description>
			<content:encoded><![CDATA[<div>Hi all.<br />
I am writing a utility to manage virtual users on a mailserver w/ mysql backed. Unfortunately I am having performance issues when querying for the user's last access date/time.<br />
<br />
DB has this structure<br />
<br />
table <span style="font-weight:bold">users</span><br />
 <pre style="margin:20px; line-height:13px">+------------------+-------------+------+-----+---------+-------+<br />
| Field&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Type&nbsp; &nbsp; &nbsp; &nbsp; | Null | Key | Default | Extra |<br />
+------------------+-------------+------+-----+---------+-------+<br />
| email&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | varchar(80) | NO&nbsp;  | PRI | NULL&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp;  |<br />
| force_change_pwd | int(1)&nbsp; &nbsp; &nbsp; | NO&nbsp;  |&nbsp; &nbsp;  | 0&nbsp; &nbsp; &nbsp;  |&nbsp; &nbsp; &nbsp;  |<br />
| password&nbsp; &nbsp; &nbsp; &nbsp;  | md5(20)&nbsp; &nbsp;  | NO&nbsp;  |&nbsp; &nbsp;  | NULL&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp;  |<br />
| creation_date&nbsp; &nbsp; | datetime&nbsp; &nbsp; | YES&nbsp; |&nbsp; &nbsp;  | NULL&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp;  |<br />
+------------------+-------------+------+-----+---------+-------+</pre><br />
table <span style="font-weight:bold">user_activity</span><br />
<br />
 <pre style="margin:20px; line-height:13px">+----------------+--------------+------+-----+---------+----------------+<br />
| Field&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Type&nbsp; &nbsp; &nbsp; &nbsp;  | Null | Key | Default | Extra&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
+----------------+--------------+------+-----+---------+----------------+<br />
| id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  | int(11)&nbsp; &nbsp; &nbsp; | NO&nbsp;  | PRI | NULL&nbsp; &nbsp; | auto_increment |<br />
| event&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | varchar(30)&nbsp; | NO&nbsp;  | MUL | NULL&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
| username&nbsp; &nbsp; &nbsp;  | varchar(128) | NO&nbsp;  |&nbsp; &nbsp;  | NULL&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
| domain&nbsp; &nbsp; &nbsp; &nbsp;  | varchar(128) | NO&nbsp;  | MUL | NULL&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
| remote_address | varchar(255) | NO&nbsp;  |&nbsp; &nbsp;  | NULL&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
| date&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  | datetime&nbsp; &nbsp;  | NO&nbsp;  | MUL | NULL&nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
| comments&nbsp; &nbsp; &nbsp;  | varchar(255) | YES&nbsp; |&nbsp; &nbsp;  |&nbsp; &nbsp; &nbsp; &nbsp;  |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
+----------------+--------------+------+-----+---------+----------------+</pre><br />
<br />
In my PHP page, I have the following code<br />
<br />
 <pre style="margin:20px; line-height:13px">$mbox_users = 'SELECT email, creation_date FROM users ORDER BY email ASC';<br />
$result = mysql_query($mbox_users) or die (&quot;There was a problem with the SQL query: &quot; . mysql_error());<br />
while($row = mysql_fetch_assoc($result))<br />
{<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; $email=$row['email'];<br />
&nbsp; &nbsp; &nbsp; &nbsp; $date=$row['creation_date'];<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (is_null($date)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $date = &quot;N/A&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mbox_access=&quot;SELECT date FROM user_activity&nbsp; WHERE username = '&quot;.$row['email'].&quot;' ORDER BY date DESC LIMIT 1&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $result_access = mysql_query($mbox_access) or die (&quot;There was a problem with the SQL query: &quot; . mysql_error());<br />
&nbsp; &nbsp; &nbsp; &nbsp; $last = mysql_fetch_assoc($result_access);<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo '&lt;li&gt;'.$email.' (&lt;b&gt;Created: &lt;/b&gt;'.$date.' - &lt;b&gt;Last Access: &lt;/b&gt;'.$last['date'].')&lt;/li&gt;';</pre><br />
<br />
Unfortunately with +20k users and over 100k records in the <span style="font-weight:bold">user_activity</span> table, the queries are awfully slow.<br />
Am I missing some obvious method of making the query faster?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>trashed</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232856.html</guid>
		</item>
		<item>
			<title>Inserting data to mysql database using php created form</title>
			<link>http://www.daniweb.com/forums/thread232496.html</link>
			<pubDate>Fri, 23 Oct 2009 04:14:07 GMT</pubDate>
			<description>Dear all, 
 
I am trying to submit my data on a php created form to mysql database where it is separate by 2 tables (device) and (location). 
 
As some of the devices shared the same location, 2 tables are created as below. 
For location table, i had created 2 fields: ID as (primary key) and area....</description>
			<content:encoded><![CDATA[<div>Dear all,<br />
<br />
I am trying to submit my data on a php created form to mysql database where it is separate by 2 tables (device) and (location).<br />
<br />
As some of the devices shared the same location, 2 tables are created as below.<br />
For location table, i had created 2 fields: ID as (primary key) and area.<br />
For device, i created 3 fields: ID (primary key), device_num and device_loc.<br />
<br />
Using php, i created a form where user will enter the device number and the location. <br />
<br />
The problem is i can insert the device number to my device table in mysql database and i have no idea how to link up the location table to my device table.  Appreciated if some help of advise is given to me. <br />
<br />
Below are the simple code of the insertion of my device table.<br />
<br />
 <pre style="margin:20px; line-height:13px">$val_d = $_POST['Device_num'];&nbsp; &nbsp; //value submit from user <br />
$val_l = $_POST['location_area'];&nbsp; //value submit from user <br />
<br />
$dev_insert = &quot;INSERT INTO device (device_id, device_num)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VALUES (NULL, '$val_d')&quot;;<br />
$results = mysql_query($dev_insert)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; or die (mysql_error());</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>futhonguy</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232496.html</guid>
		</item>
		<item>
			<title>SQL Server 2005 error</title>
			<link>http://www.daniweb.com/forums/thread232275.html</link>
			<pubDate>Thu, 22 Oct 2009 11:30:28 GMT</pubDate>
			<description><![CDATA[I am a new SQL user and I have created my code but when I execute it I get this error : 
 
Msg 2714, Level 16, State 6, Line 1 
There is already an object named 'Job_Title' in the database. 
 
I do not understand why I keep getting this same error.   
Here is my code: 
 
CREATE TABLE Job_Title 
(]]></description>
			<content:encoded><![CDATA[<div>I am a new SQL user and I have created my code but when I execute it I get this error :<br />
<br />
<span style="color:Red">Msg 2714, Level 16, State 6, Line 1<br />
There is already an object named 'Job_Title' in the database.</span><br />
<br />
I do not understand why I keep getting this same error.  <br />
Here is my code:<br />
<br />
 <pre style="margin:20px; line-height:13px">CREATE TABLE Job_Title<br />
(<br />
Job_ID&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOT NULL<br />
&nbsp; &nbsp; &nbsp; &nbsp; PRIMARY KEY(Job_ID),<br />
EEO1_Class&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(20)&nbsp; &nbsp; &nbsp; &nbsp; NOT NULL,<br />
Job_Title&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(40) NOT NULL,<br />
Job_Descrip&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(100)NOT NULL,<br />
Status&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(10)&nbsp; &nbsp; &nbsp; &nbsp; NOT NULL<br />
)<br />
<br />
CREATE TABLE Employee<br />
(<br />
Emp_ID&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOT NULL<br />
&nbsp; &nbsp; &nbsp; &nbsp; PRIMARY KEY(Emp_ID),<br />
Last_Name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(50) NOT NULL,<br />
First_Name&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(50)&nbsp; &nbsp; &nbsp; &nbsp; NOT NULL,<br />
Address&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(50)&nbsp; &nbsp; &nbsp; &nbsp; NOT NULL,<br />
City&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(25)&nbsp; &nbsp; &nbsp; &nbsp; NOT NULL,<br />
State&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(20)&nbsp; &nbsp; &nbsp; &nbsp; NOT NULL,<br />
Phone_AC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char(3)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOT NULL,<br />
Phone_Num&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char(7)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOT NULL,<br />
Ssn&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char(9)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOT NULL,<br />
Hire_Date&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; datetime&nbsp; &nbsp; &nbsp; &nbsp; NOT NULL,<br />
Salary&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; numeric(6,2)&nbsp; &nbsp; &nbsp; &nbsp; NOT NULL,<br />
Gender&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(6)&nbsp; &nbsp; &nbsp; &nbsp; NOT NULL,<br />
Birthday&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; datetime&nbsp; &nbsp; &nbsp; &nbsp; NOT NULL,<br />
Job_ID&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int&nbsp; &nbsp; &nbsp; &nbsp; FOREIGN KEY REFERENCES Job_Title (Job_ID)<br />
)</pre><br />
<br />
And a few examples of my INSERT statements:<br />
<br />
 <pre style="margin:20px; line-height:13px">INSERT INTO Employee (Emp_ID,Last_Name,First_Name,Address,City,State,Phone_AC,<br />
&nbsp; &nbsp; &nbsp; &nbsp; Phone_Num,Ssn,Hire_Date,Salary,Gender,Birthday,Job_ID)<br />
VALUES (62683,'Edelman','Glenn','175 Bishop Lane','La Jolla','California',619,555-0199,112333445,<br />
&nbsp; &nbsp; &nbsp; &nbsp; 10/07/2003,11.25,'male',11/02/1981,004)<br />
<br />
<br />
INSERT INTO Job_Title (Job_ID,EEO1_Class,Job_Title,Job_Descrip,Status)<br />
VALUES (001,'Office/Clerical','Accounting Clerk','Computes, classifies, records, and verifies numerical<br />
&nbsp; &nbsp; &nbsp; &nbsp; data for use in maintaining accounting records','NonExempt')</pre><br />
<br />
Thanks for your help!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>s28walters</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232275.html</guid>
		</item>
		<item>
			<title>Any experience with MySQL Dump Timer ?</title>
			<link>http://www.daniweb.com/forums/thread232202.html</link>
			<pubDate>Thu, 22 Oct 2009 07:22:09 GMT</pubDate>
			<description>Anyone has experince with MySQL Dump Timer tool ? 
I just download it from here :  
http://www.softwarevenue.com/download/mysql-dump-timer/ 
 
Is it good ? 
I have not install it yet, still looking for more information about this tool 
This is the sort description from the site : 
MySQL Backup /...</description>
			<content:encoded><![CDATA[<div>Anyone has experince with MySQL Dump Timer tool ?<br />
I just download it from here : <br />
<a rel="nofollow" class="t" href="http://www.softwarevenue.com/download/mysql-dump-timer/" target="_blank">http://www.softwarevenue.com/download/mysql-dump-timer/</a><br />
<br />
Is it good ?<br />
I have not install it yet, still looking for more information about this tool<br />
This is the sort description from the site :<br />
<span style="font-style:italic">MySQL Backup / MySQL Dump and MySQL Restore scheduler – local/ remote in the Web</span></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>sylstain</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232202.html</guid>
		</item>
		<item>
			<title>My data not appear</title>
			<link>http://www.daniweb.com/forums/thread232151.html</link>
			<pubDate>Thu, 22 Oct 2009 03:50:00 GMT</pubDate>
			<description><![CDATA[<div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags" target="_blank">Help with Code Tags</a> </div> <div> <strong>MySQL Syntax</strong> (<a...]]></description>
			<content:encoded><![CDATA[<div> <pre style="margin:20px; line-height:13px">&quot;SELECT tbl1.staff_ic, tbl1.staff_name, tbl2.dec_status,tbl4.location,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tbl3.post,tbl3.grade&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FROM staff_detail tbl1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INNER JOIN staff_declare tbl2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ON tbl1.staff_ic = tbl2.staff_ic<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INNER JOIN staff_post tbl3<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ON tbl1.staff_post = tbl3.num<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INNER JOIN staff_department tbl4<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ON tbl1.staff_dep = tbl4.no<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;;</pre>isn`t my coding is right?? why when i execute my command just certain data are appear and the rest not appear</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>aerliana</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232151.html</guid>
		</item>
		<item>
			<title>SQL Injection -measures for prevention</title>
			<link>http://www.daniweb.com/forums/thread232097.html</link>
			<pubDate>Wed, 21 Oct 2009 22:55:02 GMT</pubDate>
			<description><![CDATA[Hi, I'm making litle CMS with PHP+Mysql. Can you tellme measures for prevention  for SQL Injections ?]]></description>
			<content:encoded><![CDATA[<div>Hi, I'm making litle CMS with PHP+Mysql. Can you tellme measures for prevention  for SQL Injections ?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>ultras1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232097.html</guid>
		</item>
		<item>
			<title>help - ordering</title>
			<link>http://www.daniweb.com/forums/thread232016.html</link>
			<pubDate>Wed, 21 Oct 2009 15:50:03 GMT</pubDate>
			<description><![CDATA[Hello! I need some help please.. 
 
i searched a lot, and tried everything... can someone help me please.. 
 
here's the deal: 
 
i have this select: 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a...]]></description>
			<content:encoded><![CDATA[<div>Hello! I need some help please..<br />
<br />
i searched a lot, and tried everything... can someone help me please..<br />
<br />
here's the deal:<br />
<br />
i have this select:<br />
<br />
 <pre style="margin:20px; line-height:13px">SELECT * <br />
FROM localizacao, cliente, dispositivo&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
WHERE disp_id = clien_disp_id AND disp_id = local_disp_id <br />
ORDER BY local_id desc</pre><br />
it's output:<br />
<a rel="nofollow" class="t" href="http://i.imagehost.org/0746/tabela.jpg" target="_blank">http://i.imagehost.org/0746/tabela.jpg</a><br />
<br />
but what i really want is:<br />
<br />
i want to select my client's, but where local_id is the last id i receive.. but i don't wanna show repetitive client's, i just want to show the last local_id for each client....<br />
<span style="font-weight:bold">i want like to show only this ones: <a rel="nofollow" class="t" href="http://i.imagehost.org/0883/tabela2.jpg" target="_blank">http://i.imagehost.org/0883/tabela2.jpg</a> in the red circle</span><br />
<br />
you know what i mean? <br />
it's like two order by's but not showing repetitive client's... i tried distinct... but maybe im making it wrong..<br />
<br />
help :s<br />
<br />
thanks a lot</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>gpss</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232016.html</guid>
		</item>
		<item>
			<title>Selecting a certain number of results from a specified row</title>
			<link>http://www.daniweb.com/forums/thread231923.html</link>
			<pubDate>Wed, 21 Oct 2009 10:06:07 GMT</pubDate>
			<description><![CDATA[As the title says, I'd like to select a certain number of rows from a table starting from a specified row. 
 
So for example, I have a table with 250 rows and the rows are numbered incrementally using a column called 'ref'. I now want to select rows 51-100. How would I go about doing that?]]></description>
			<content:encoded><![CDATA[<div>As the title says, I'd like to select a certain number of rows from a table starting from a specified row.<br />
<br />
So for example, I have a table with 250 rows and the rows are numbered incrementally using a column called 'ref'. I now want to select rows 51-100. How would I go about doing that?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Venom Rush</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231923.html</guid>
		</item>
		<item>
			<title>challenging query - Insert On duplicate field?  not on duplicate key</title>
			<link>http://www.daniweb.com/forums/thread231865.html</link>
			<pubDate>Wed, 21 Oct 2009 06:38:57 GMT</pubDate>
			<description>I want to insert multiple records or update those records if 2 specific column values do not exist in a record.  But the 2 values are NOT UNIQUE, so I can not use ON DUPLICATE KEY.  I am trying to not use IF...Then statements.  It seems to be bad programming practice. 
 
Here is the pseudo code of...</description>
			<content:encoded><![CDATA[<div>I want to insert multiple records or update those records if 2 specific column values do not exist in a record.  But the 2 values are NOT UNIQUE, so I can not use ON DUPLICATE KEY.  I am trying to not use IF...Then statements.  It seems to be bad programming practice.<br />
<br />
Here is the pseudo code of what I want to accomplish.<br />
<br />
 <pre style="margin:20px; line-height:13px">INSERT INTO interest_list (user_id, interest_id, details)<br />
&nbsp; VALUES<br />
&nbsp; (1, 1,'somestring1'),<br />
&nbsp; (1, 2, 'somestring2'), <br />
&nbsp;...etc<br />
<span style="color:Red">IF the record exists where (user_id==1 and interest_id==1) or (user_id==1 and interest_id==2)&nbsp; ... etc THEN (dont insert but rather update)</span><br />
UPDATE interest_list<br />
&nbsp; &nbsp; SET details = CASE interest_id<br />
&nbsp; &nbsp; &nbsp; &nbsp; WHEN 1 THEN 'somestring1'<br />
&nbsp; &nbsp; &nbsp; &nbsp; WHEN 2 THEN 'somestring2'<br />
...etc<br />
&nbsp; &nbsp; END<br />
WHERE interest_id IN (1,2...etc) AND user_id=1;</pre><br />
Its fairly complicated to explain, hopefully someone gets my question.  I am trying to accomplish this in 1 query.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>ucud</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231865.html</guid>
		</item>
		<item>
			<title>How to insert date in string format into MYSQL table as DATE data type</title>
			<link>http://www.daniweb.com/forums/thread231445.html</link>
			<pubDate>Mon, 19 Oct 2009 17:29:25 GMT</pubDate>
			<description>Hello people, 
 
Well The problem that I am facing is: 
I have a date in string format like 30 Jun 2009, how can I insert it into MYSQL table as DATE data type?  
 
I created the table and declare data type for Date column as DATE, when I insert 30 Jun 2009 as a value into the table, it becomes...</description>
			<content:encoded><![CDATA[<div>Hello people,<br />
<br />
Well The problem that I am facing is:<br />
I have a date in string format like 30 Jun 2009, how can I insert it into MYSQL table as DATE data type? <br />
<br />
I created the table and declare data type for Date column as DATE, when I insert 30 Jun 2009 as a value into the table, it becomes 00:00:00. What should I do to avoid this error.  Please suggest. Thanks<br />
<br />
Ajay</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>ajay_p5</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231445.html</guid>
		</item>
		<item>
			<title>Newbie Help with SQL Filter/Search</title>
			<link>http://www.daniweb.com/forums/thread231422.html</link>
			<pubDate>Mon, 19 Oct 2009 15:21:29 GMT</pubDate>
			<description><![CDATA[Hi all,  
 
I'm a newbie in sql, please can someone help me out in constructing a query. What I want to achieve is to have filter/search menu with a list of the different options/optionsvalues that applies to a particular category of products and a count of the products that possess each attribute....]]></description>
			<content:encoded><![CDATA[<div>Hi all, <br />
<br />
I'm a newbie in sql, please can someone help me out in constructing a query. What I want to achieve is to have filter/search menu with a list of the different options/optionsvalues that applies to a particular category of products and a count of the products that possess each attribute.<br />
Say under COLOR we have Black (2), Blue(17), Green(21) and under SIZE we have 10m(11), 20m(15). My tables areas follows:<br />
<br />
categories =&gt; catid, parentid<br />
products =&gt; productid, catid<br />
options =&gt; optionsid, options_name (e.g Colour, Size)<br />
optionsvalues =&gt; optionsvaluesid, optionsvalues_name (e.g Black, Blue, Green, 10m, 20m, 30m)<br />
options2optionsvalues =&gt;options2optionsvaluesid, optionsid, optionsvaluesid<br />
products_attributes =&gt; attributeid, productid, catid, optionsid, optionsvaluesid<br />
<br />
I really need your help.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Vikk</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231422.html</guid>
		</item>
		<item>
			<title>Connection Issues with SSH</title>
			<link>http://www.daniweb.com/forums/thread231273.html</link>
			<pubDate>Mon, 19 Oct 2009 01:20:19 GMT</pubDate>
			<description><![CDATA[MySQL database server is running on ubuntu. I have installed an GUI for everybody in office to access the database called Navicat. It uses ssh to access the database. It was working on almost everybody's machine week back. Now its not working on few machines and I am not sure about the reason for...]]></description>
			<content:encoded><![CDATA[<div>MySQL database server is running on ubuntu. I have installed an GUI for everybody in office to access the database called Navicat. It uses ssh to access the database. It was working on almost everybody's machine week back. Now its not working on few machines and I am not sure about the reason for this. <br />
-I checked the connections details <br />
-The ipconfig /all shows the same dns server and gateways on computers working and not working.<br />
-I disabled all the firewalls and aniviruses on both the server and the client machine but still it is not working. I was working on that machine a week ago.<br />
I was not able to figure out the reason. Please let me know if you have any suggestions.<br />
<br />
The second problem is that I need to give remote access. I was wanting to open up the router port for this purpose which is not opening. I am not sure if this is the right way to do it from a security standpoint. Please let know if you have any views on this as well.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>zackkv</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231273.html</guid>
		</item>
		<item>
			<title>Need help with primary keys in a many-to-many schema</title>
			<link>http://www.daniweb.com/forums/thread231035.html</link>
			<pubDate>Sat, 17 Oct 2009 20:48:14 GMT</pubDate>
			<description><![CDATA[Hello, 
 
I'll preface by saying this is a school project.  I just need to be pointed in the right direction. 
 
I'm trying to develop a database of books.  In and of itself, that's simple enough, but I'm also trying to implement a tagging system following this solution...]]></description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
I'll preface by saying this is a school project.  I just need to be pointed in the right direction.<br />
<br />
I'm trying to develop a database of books.  In and of itself, that's simple enough, but I'm also trying to implement a tagging system following <a rel="nofollow" class="t" href="http://www.pui.ch/phred/archives/2005/04/tags-database-schemas.html#toxi" target="_blank">this solution</a>.<br />
<br />
Where I'm getting tripped up is with the fact that their solution uses one column as primary key per table.  In order to prevent duplicate books from being added to my database, I'm thinking it would make sense for my primary key in the Books table to consist of both the Author name as well as the Title (since the same author can write more than one book, and different authors can write similarly-titled books, but no one author is going to write two books with the same title).  The other two tables (Tags and TagMap) will only use a single-column primary key.<br />
<br />
Would the linked solution work if the &quot;Bookmark&quot; table used a two-column primary key?<br />
<br />
If not, do you have any better ideas for designing a table for books that would use a single-column primary key yet also prevent entry of duplicates?  ISBN is not an option since many of the books in the table are independently published and are not registered.<br />
<br />
Thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>statutoryape</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231035.html</guid>
		</item>
		<item>
			<title>A specific Narrow-Down Filter using MySQL</title>
			<link>http://www.daniweb.com/forums/thread230366.html</link>
			<pubDate>Thu, 15 Oct 2009 10:52:50 GMT</pubDate>
			<description>Hi, 
 
Check out http://www.landwatch.com/Land_For_Sale 
 
Notice the filters on the left column and how they all have the count of the entries within them. I am sure they are not calculating all these count at the run-time. They have these values stored somewhere and just retrieving the top 5...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
Check out <a rel="nofollow" class="t" href="http://www.landwatch.com/Land_For_Sale" target="_blank">http://www.landwatch.com/Land_For_Sale</a><br />
<br />
Notice the filters on the left column and how they all have the count of the entries within them. I am sure they are not calculating all these count at the run-time. They have these values stored somewhere and just retrieving the top 5 values. Not sure how this can be done. Any insight?<br />
<br />
I hear that datacubes with all these dimensions can give this result instantaneously. But I'd like to think there's an easier solution.<br />
<br />
Help!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>dipaq1976</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230366.html</guid>
		</item>
		<item>
			<title>SQL Script</title>
			<link>http://www.daniweb.com/forums/thread230304.html</link>
			<pubDate>Thu, 15 Oct 2009 07:15:04 GMT</pubDate>
			<description>How can I create a SQL Script using MySql? 
 
I already created a database and tables. I populated the tables and wrote queries to solve the questions in my homework. But the professor want me to submit the SQL script. 
 
Can anyone help me?</description>
			<content:encoded><![CDATA[<div>How can I create a SQL Script using MySql?<br />
<br />
I already created a database and tables. I populated the tables and wrote queries to solve the questions in my homework. But the professor want me to submit the SQL script.<br />
<br />
Can anyone help me?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Samyx</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230304.html</guid>
		</item>
		<item>
			<title>newbie mysql join help</title>
			<link>http://www.daniweb.com/forums/thread230177.html</link>
			<pubDate>Wed, 14 Oct 2009 18:09:36 GMT</pubDate>
			<description>I need a bit of help with a mysql join query.  I have tried and tried and keep getting unhelpful errors. 
 
I have two mysql tables: 
 
friends: 
   friend1  INT 
   friend2  INT 
 
members: 
   member_id  INT</description>
			<content:encoded><![CDATA[<div>I need a bit of help with a mysql join query.  I have tried and tried and keep getting unhelpful errors.<br />
<br />
I have two mysql tables:<br />
<br />
friends:<br />
   friend1  INT<br />
   friend2  INT<br />
<br />
members:<br />
   member_id  INT<br />
   name    varchar<br />
   lname  varchar<br />
<br />
<br />
Basically I want to loop through friends and find all records where friend1 is my member_id and then get the details for friend2 from the members file. I need a query that will return the data in members IF members.member_id  = friends.friend2 AND where friends.friend1 = 1.<br />
<br />
Can any one help me here?  I think if I could get the basic down I can expand from there, but dang if I am getting nowhere on this join &lt;g&gt;</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>andym67</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230177.html</guid>
		</item>
		<item>
			<title>email users when new record is added</title>
			<link>http://www.daniweb.com/forums/thread230010.html</link>
			<pubDate>Wed, 14 Oct 2009 04:42:48 GMT</pubDate>
			<description>Hi, 
 
Basically what im looking to implement is a function where a user performs a search on my site, and is presented with the results and an option to be emailed similar items in future. 
 
I have all the search stuff done, but have no idea where to start on the email me similar items in future...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
Basically what im looking to implement is a function where a user performs a search on my site, and is presented with the results and an option to be emailed similar items in future.<br />
<br />
I have all the search stuff done, but have no idea where to start on the email me similar items in future part.<br />
<br />
Any help much appreciated</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>stylemessiah</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230010.html</guid>
		</item>
		<item>
			<title>Inner Joins</title>
			<link>http://www.daniweb.com/forums/thread229956.html</link>
			<pubDate>Tue, 13 Oct 2009 22:47:10 GMT</pubDate>
			<description><![CDATA[<div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags" target="_blank">Help with Code Tags</a> </div> <div> <strong>MySQL Syntax</strong> (<a...]]></description>
			<content:encoded><![CDATA[<div> <pre style="margin:20px; line-height:13px">&lt;?php<br />
<br />
$host='localhost';<br />
&nbsp; &nbsp; &nbsp; &nbsp; $user='root';<br />
&nbsp; &nbsp; &nbsp; &nbsp; $pass='';<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; //establish database connection<br />
&nbsp; &nbsp; &nbsp; &nbsp; $conn=mysql_connect($host,$user,$pass) or die('Unable to connect');<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; //select database for use<br />
&nbsp; &nbsp; mysql_select_db('acumenchain') or die('Unable to select database!');<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $query2 = &quot;SELECT tblclasslist.studentNo <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FROM acumenchain.tblclasslist <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JOIN acumenchain.tblregistration <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ON tblclasslist.studentNo = tblclasslist.studentNo&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = mysql_query($query2) or die('Unable to execute Query' . mysql_error());<br />
&nbsp; &nbsp; &nbsp; &nbsp; $num = mysql_num_rows($result);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; //close connection<br />
&nbsp; &nbsp; mysql_close($conn);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
?&gt;</pre><br />
database name : acumenchain<br />
Under my tblclasslist is studentNo (primary key).<br />
Under my tblregistration is studentNo (primary key) and pword<br />
Under my tbllogin is studentNo (primary key) and pword.<br />
<br />
<span style="font-weight:bold">Objectives:</span><ul><li>I want that only students who are registered in the tblclasslist can register on tblregistration.</li>
<li>I want that only who are registered can log-in to my site using his/her studentNo and pword.</li>
</ul>Thanks:confused:</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>theo19</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229956.html</guid>
		</item>
		<item>
			<title>Capacity of datatypes???</title>
			<link>http://www.daniweb.com/forums/thread229760.html</link>
			<pubDate>Tue, 13 Oct 2009 08:56:54 GMT</pubDate>
			<description>I want to find the capacity of my data fields....how can i calculate capacity of varchar(10)  or int(15)...????  (in kilobytes s or megabytes s) 
please help..t 
hankx in advance.</description>
			<content:encoded><![CDATA[<div>I want to find the capacity of my data fields....how can i calculate capacity of varchar(10)  or int(15)...????  (in kilobytes s or megabytes s)<br />
please help..t<br />
hankx in advance.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jrosh</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229760.html</guid>
		</item>
		<item>
			<title>Are websites like daniweb suppose to keep user history log for a amount of time?</title>
			<link>http://www.daniweb.com/forums/thread229678.html</link>
			<pubDate>Tue, 13 Oct 2009 01:38:12 GMT</pubDate>
			<description><![CDATA[I'm trying to find out what the legal laws for the internet are on storing text via e-mail/chat. I am not sure if there is such a law but than again it's better to ask than to find out the hard way. Does DaniWeb keep history of Private messages for a certain amount of time? Is there a government or...]]></description>
			<content:encoded><![CDATA[<div>I'm trying to find out what the legal laws for the internet are on storing text via e-mail/chat. I am not sure if there is such a law but than again it's better to ask than to find out the hard way. Does DaniWeb keep history of Private messages for a certain amount of time? Is there a government or some official webpage that lists the laws on what data you are legally suppose to keep or aren't suppose to keep as a website owner that allows users to have their own accounts?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>the_programmer</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229678.html</guid>
		</item>
		<item>
			<title>Help desiging mysql table tree structure</title>
			<link>http://www.daniweb.com/forums/thread229666.html</link>
			<pubDate>Tue, 13 Oct 2009 01:07:18 GMT</pubDate>
			<description><![CDATA[I currently have a table structure like this 
 
create table main(id int(10) unsigned NOT NULL AUTO_INCREMENT, fname varchar(25) NOT NULL DEFAULT '', `uid` int(10) unsigned NOT NULL,  PRIMARY KEY (`id`)) 
 
insert into main(1, 'abcd', 1), (2,'doll',1), (3,'animals',1) 
 
CREATE TABLE category ( 
 ...]]></description>
			<content:encoded><![CDATA[<div>I currently have a table structure like this<br />
<br />
 <pre style="margin:20px; line-height:13px">create table main(id int(10) unsigned NOT NULL AUTO_INCREMENT, fname varchar(25) NOT NULL DEFAULT '', `uid` int(10) unsigned NOT NULL,&nbsp; PRIMARY KEY (`id`))<br />
<br />
insert into main(1, 'abcd', 1), (2,'doll',1), (3,'animals',1)<br />
<br />
CREATE TABLE category (<br />
&nbsp; `cid` int(3) NOT NULL AUTO_INCREMENT,<br />
&nbsp; `id` int(2) NOT NULL DEFAULT '0',<br />
&nbsp; `category` varchar(25) NOT NULL DEFAULT '',<br />
&nbsp; PRIMARY KEY (`cid`)<br />
) <br />
<br />
insert into category(1,1,'abcd1'), (2,2,'doll1')</pre><br />
Table category is related to table main. main=&gt;category<br />
<br />
I need 3 level nesting<br />
<br />
main=&gt;category=&gt;subcat1=&gt;subcat2<br />
<br />
How do i modify the table structure?<br />
<br />
Thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>newtojsp</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229666.html</guid>
		</item>
		<item>
			<title>Best way to save image submitted via a form</title>
			<link>http://www.daniweb.com/forums/thread229356.html</link>
			<pubDate>Sun, 11 Oct 2009 20:24:57 GMT</pubDate>
			<description>Hi, 
I am creating a website where users will be able to submit forms. In the form they will be able to submit text and uploaded images. With regards to uploaded images, once they are submitted, what is the best way to save them? Is it to a MySQL database or save it to the disk itself.  
Could...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
I am creating a website where users will be able to submit forms. In the form they will be able to submit text and uploaded images. With regards to uploaded images, once they are submitted, what is the best way to save them? Is it to a MySQL database or save it to the disk itself. <br />
Could someone give an example of whichever way is the best way? Any help is appreciated.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>waleed66</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229356.html</guid>
		</item>
		<item>
			<title>Mysql select tip</title>
			<link>http://www.daniweb.com/forums/thread229254.html</link>
			<pubDate>Sun, 11 Oct 2009 07:55:54 GMT</pubDate>
			<description><![CDATA[Hai,  
 
I had a mysql database and it contain columns like "id" and "name". 
 
I am using the following query for selecting a name with an id . 
 
My code is 
 
$row=mysql_select("SELECT * FROM table where id='1'") or die(mysql_error()); 
$result=mysql_fetch_array($ROW);]]></description>
			<content:encoded><![CDATA[<div>Hai, <br />
<br />
I had a mysql database and it contain columns like &quot;id&quot; and &quot;name&quot;.<br />
<br />
I am using the following query for selecting a name with an id .<br />
<br />
My code is<br />
<br />
 <pre style="margin:20px; line-height:13px">$row=mysql_select(&quot;SELECT * FROM table where id='1'&quot;) or die(mysql_error());<br />
$result=mysql_fetch_array($ROW);<br />
<br />
$name=$result['name'];</pre><br />
<br />
It works and my problem is please let me know whether it is the easy way ? Or there is any other way to do this ?<br />
<br />
<br />
Thanks in advance<br />
Rajeesh</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>rajeesh_rsn</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229254.html</guid>
		</item>
		<item>
			<title>mysql query</title>
			<link>http://www.daniweb.com/forums/thread229137.html</link>
			<pubDate>Sat, 10 Oct 2009 16:27:37 GMT</pubDate>
			<description><![CDATA[hello 
 
i'm beginner with php/mysql on windows xp platform 
 
i've worked with ms sql server in which we have query analyser to work with queries, i am not familier with running queries on my sql 
 
i've installed mysql-essential-5.1.39-win32 from 
http://dev.mysql.com/downloads/mysql/5.1.html 
...]]></description>
			<content:encoded><![CDATA[<div>hello<br />
<br />
i'm beginner with php/mysql on windows xp platform<br />
<br />
i've worked with ms sql server in which we have query analyser to work with queries, i am not familier with running queries on my sql<br />
<br />
i've installed mysql-essential-5.1.39-win32 from<br />
<a rel="nofollow" class="t" href="http://dev.mysql.com/downloads/mysql/5.1.html" target="_blank">http://dev.mysql.com/downloads/mysql/5.1.html</a><br />
<br />
but do not know how to operate with it<br />
<br />
please help</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>dips255</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229137.html</guid>
		</item>
		<item>
			<title>how to save link in database</title>
			<link>http://www.daniweb.com/forums/thread229132.html</link>
			<pubDate>Sat, 10 Oct 2009 16:08:13 GMT</pubDate>
			<description><![CDATA[hi dear, 
i'm going to develop database that can access file in the user profile folder. but, i dun know how to create link in database mysql. i have 5 field in database.username,password,email and file. file contain link that access the file in file://C. i dont know how to do dat. please ya help...]]></description>
			<content:encoded><![CDATA[<div>hi dear,<br />
i'm going to develop database that can access file in the user profile folder. but, i dun know how to create link in database mysql. i have 5 field in database.username,password,email and file. file contain link that access the file in file://C. i dont know how to do dat. please ya help me here<br />
bye dear</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>nazarahmat</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229132.html</guid>
		</item>
		<item>
			<title>is one database for images for all users the best idea?</title>
			<link>http://www.daniweb.com/forums/thread229042.html</link>
			<pubDate>Sat, 10 Oct 2009 06:09:01 GMT</pubDate>
			<description><![CDATA[hey; 
I'm creating a image database. I want each user to register, login and be able to upload images. I however, do not know if each user needs to have their own database for images to be stored in or if I can grab the image via foreign ids from one big database. I don't want users to open their...]]></description>
			<content:encoded><![CDATA[<div>hey;<br />
I'm creating a image database. I want each user to register, login and be able to upload images. I however, do not know if each user needs to have their own database for images to be stored in or if I can grab the image via foreign ids from one big database. I don't want users to open their album and see someone elses images... that wouldn't be good! Any help is appreciated!!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>the_programmer</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229042.html</guid>
		</item>
		<item>
			<title>Question about 2 overlapping many-to-many lookup tables</title>
			<link>http://www.daniweb.com/forums/thread229014.html</link>
			<pubDate>Sat, 10 Oct 2009 03:07:44 GMT</pubDate>
			<description><![CDATA[I am updating a conference website, and I've come across a design problem that has me stumped. I have tables for: 
-a company's account 
-person (each company can have many persons in its account) 
-conference sections (for example, 1-day, 2-day, or 3-day attendance) 
-a lookup table relating...]]></description>
			<content:encoded><![CDATA[<div>I am updating a conference website, and I've come across a design problem that has me stumped. I have tables for:<br />
-a company's account<br />
-person (each company can have many persons in its account)<br />
-conference sections (for example, 1-day, 2-day, or 3-day attendance)<br />
-a lookup table relating people to sections (this would allow a company to have 3 people attend this year, but then only send 2 of those 3 next year, for instance)<br />
<br />
Here are abbreviated CREATE statements:<br />
<br />
 <pre style="margin:20px; line-height:13px">CREATE&nbsp; TABLE IF NOT EXISTS `accounts` (<br />
&nbsp; `account_id` INT(10) NOT NULL AUTO_INCREMENT ,<br />
&nbsp; `username` VARCHAR(255) NOT NULL ,<br />
&nbsp; `password` CHAR(64) NULL ,<br />
&nbsp; `email` VARCHAR(255) NOT NULL ,<br />
&nbsp; `company` VARCHAR(255) NULL ,<br />
&nbsp; PRIMARY KEY (`account_id`) )&nbsp; (... remainder of CREATE statement omitted)<br />
<br />
<br />
CREATE&nbsp; TABLE IF NOT EXISTS `persons` (<br />
&nbsp; `person_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,<br />
&nbsp; `firstname` VARCHAR(45) NOT NULL ,<br />
&nbsp; `lastname` VARCHAR(45) NOT NULL ,<br />
&nbsp; `jobtitle` VARCHAR(255) NULL DEFAULT NULL ,<br />
&nbsp; `phone` CHAR(12) NULL DEFAULT NULL ,<br />
&nbsp; `email` VARCHAR(255) NOT NULL ,<br />
&nbsp; PRIMARY KEY (`person_id`) ,<br />
&nbsp; INDEX `fk_person_account` (`account_id` ASC) ,<br />
&nbsp; CONSTRAINT `fk_person_account`<br />
&nbsp; &nbsp; FOREIGN KEY (`account_id` )&nbsp; &nbsp; (... remainder of CREATE statement omitted)<br />
<br />
CREATE&nbsp; TABLE IF NOT EXISTS `sections` (<br />
&nbsp; `section_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,<br />
&nbsp; `name` VARCHAR(255) NOT NULL ,<br />
&nbsp; `startdate` DATE NULL ,<br />
&nbsp; `enddate` DATE NULL ,<br />
&nbsp; `base_price` INT(10) NOT NULL DEFAULT 0 ,<br />
&nbsp; PRIMARY KEY (`section_id`)&nbsp; &nbsp;  (... remainder of CREATE statement omitted)<br />
<br />
CREATE&nbsp; TABLE IF NOT EXISTS `person_attending_section` (<br />
&nbsp; `person_id` INT(10) UNSIGNED NOT NULL ,<br />
&nbsp; `section_id` INT(10) UNSIGNED NOT NULL ,<br />
&nbsp; PRIMARY KEY (`person_id`, `section_id`) ,<br />
&nbsp; INDEX `fk_person_has_section_person1` (`person_id` ASC) ,<br />
&nbsp; INDEX `fk_person_has_section_section1` (`section_id` ASC) ,<br />
&nbsp; CONSTRAINT `fk_person_has_section_person1`<br />
&nbsp; &nbsp; FOREIGN KEY (`person_id` )<br />
&nbsp; &nbsp; REFERENCES `persons` (`person_id` )<br />
&nbsp; &nbsp; ON DELETE NO ACTION<br />
&nbsp; &nbsp; ON UPDATE NO ACTION,<br />
&nbsp; CONSTRAINT `fk_person_has_section_section1`<br />
&nbsp; &nbsp; FOREIGN KEY (`section_id` )<br />
&nbsp; &nbsp; REFERENCES `sections` (`section_id` )<br />
&nbsp; &nbsp; ON DELETE NO ACTION<br />
&nbsp; &nbsp; ON UPDATE NO ACTION)<br />
ENGINE = InnoDB</pre><br />
<br />
Here's the problem:  I'd like to have an `orders` table that takes an account's `persons` who have been added to the `persons_attending_section` for this year's sections and allows the account holder to &quot;check out&quot; and pay for all those registrations. (Refunds, if necessary, would be handled off-line.) Then, if more people from that company want to attend, they could be added and &quot;checked out&quot; as a second, and separate order. After the conference is over, those orders would be locked. An account could copy an order from the previous year, but that will involve checking out again, and it will create another order for the account.<br />
<br />
I've thought about something like this:<br />
 <pre style="margin:20px; line-height:13px">CREATE&nbsp; TABLE IF NOT EXISTS `orders` (<br />
&nbsp; `orders_id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,<br />
&nbsp; `account_id` INT NOT NULL ,<br />
&nbsp; `created_on` DATETIME NOT NULL ,<br />
&nbsp; `person_id` INT(10) UNSIGNED NOT NULL ,<br />
&nbsp; `section_id` INT(10) UNSIGNED NOT NULL ,<br />
&nbsp; PRIMARY KEY (`orders_id`) )</pre><br />
with appropriate foreign keys, and just copying over person_id and section_id from all the appropriate rows of the `person_attending_section` table, but that seems inelegant and error-prone.<br />
<br />
Should I just create an artificial, auto-increment primary key for the `person_attending_section` table and have the other two keys just be foreign keys--then I could treat that table like an &quot;ordered items&quot; table from a static e-commerce style database?<br />
<br />
Any suggestions would be appreicated.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>vjwilson</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229014.html</guid>
		</item>
		<item>
			<title>server RAM to be increased</title>
			<link>http://www.daniweb.com/forums/thread228905.html</link>
			<pubDate>Fri, 09 Oct 2009 15:21:22 GMT</pubDate>
			<description>Hi  
   Following is server information 
 
OS version:Linux playpen 2.6.18-6-amd64 #1 SMP Thu Dec 25 21:08:54 UTC 2008 x86_64 GNU/Linux 
 
64 bit OS 
 
MySQL version 
mysql  Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (x86_64) using readline 5.2</description>
			<content:encoded><![CDATA[<div>Hi <br />
   Following is server information<br />
<br />
OS version:Linux playpen 2.6.18-6-amd64 #1 SMP Thu Dec 25 21:08:54 UTC 2008 x86_64 GNU/Linux<br />
<br />
64 bit OS<br />
<br />
MySQL version<br />
mysql  Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (x86_64) using readline 5.2<br />
<br />
By using TOP command mysql is allocated 4.5G and using upto 58.5 %<br />
<br />
Database size 150GB<br />
Innodb_buffer_pool_size=4GB<br />
Max connection =500  avg used connection 201<br />
<br />
Current query_cache_size = 16 M<br />
Current query_cache_used = 14 M<br />
<br />
!!] Query cache efficiency: 15.6% (3M cached / 23M selects)<br />
[!!] Query cache prunes per day: 3551088<br />
[!!] InnoDB data size / buffer pool: 104.3G/4.0G<br />
[!!] Maximum possible memory usage: 36.4G (467% of installed RAM)<br />
Physical Memory 8G<br />
 Reads / Writes: 86% / 14%<br />
<br />
server Information<br />
<br />
playpen:~# free -m<br />
             total       used       free     shared    buffers     cached<br />
Mem:          7988       3155       4832          0         66       1547<br />
-/+ buffers/cache:       1541       6447<br />
Swap:        16383         43      16340<br />
<br />
for top command<br />
<br />
      USER      PR   NI VIRT RES  SHR  S  CPU%  % MEM   TIME    COMMAND <br />
 1841 root      15   0 4903m 4.5g 4340 S  229    58.0   3835:26  mysqld<br />
<br />
PLEASE RECOMMEND SHOULD 8 GB RAM BE INCREASED ?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>ankur02018</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228905.html</guid>
		</item>
		<item>
			<title><![CDATA[MySql Service doesn't run]]></title>
			<link>http://www.daniweb.com/forums/thread228749.html</link>
			<pubDate>Fri, 09 Oct 2009 04:15:19 GMT</pubDate>
			<description><![CDATA[Hi Everybody.. I installed wamp server and Mysql services doesn't start. I've found on Google Search. and nothing to solve my problem. Can anyone help me? Thanks..]]></description>
			<content:encoded><![CDATA[<div>Hi Everybody.. I installed wamp server and Mysql services doesn't start. I've found on Google Search. and nothing to solve my problem. Can anyone help me? Thanks..</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Zero13</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228749.html</guid>
		</item>
		<item>
			<title>Trouble using ORDER BY in a UNION statement</title>
			<link>http://www.daniweb.com/forums/thread228581.html</link>
			<pubDate>Thu, 08 Oct 2009 13:55:35 GMT</pubDate>
			<description><![CDATA[As the title suggests, I'm having trouble sorting the results of a union statement. I'm trying to sort the results by date descending and it's coming out ascending. 
 
 
(SELECT a, b, c, d, e, f, date FROM table1 WHERE a=10 AND b=1) UNION (SELECT a, b, c, d, e, f, date FROM table1 WHERE a=11 AND...]]></description>
			<content:encoded><![CDATA[<div>As the title suggests, I'm having trouble sorting the results of a union statement. I'm trying to sort the results by date descending and it's coming out ascending.<br />
<br />
 <pre style="margin:20px; line-height:13px">(SELECT a, b, c, d, e, f, date FROM table1 WHERE a=10 AND b=1) UNION (SELECT a, b, c, d, e, f, date FROM table1 WHERE a=11 AND b=1) ORDER BY date DESC;</pre>I'm selecting all the same rows from the same table. The reason I'm using a UNION statement is because I have 3 different WHERE conditions.<br />
<br />
This really should work and I've gone over my code with a fine tooth comb. It's driving me crazy. Anyone have any suggestions?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>Venom Rush</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228581.html</guid>
		</item>
		<item>
			<title>Help with generating a unique number</title>
			<link>http://www.daniweb.com/forums/thread228469.html</link>
			<pubDate>Thu, 08 Oct 2009 02:38:04 GMT</pubDate>
			<description><![CDATA[hello, 
 
    I'm trying to create a database in SQL Server management Studio for a project.  I have created a tabel named Employee and I have 14 columns.  I need to set the firts column (Emp_ID) as Primary Key (accomplished) and then generate a unique number for each Emp_ID that I insert. ...]]></description>
			<content:encoded><![CDATA[<div>hello,<br />
<br />
    I'm trying to create a database in SQL Server management Studio for a project.  I have created a tabel named Employee and I have 14 columns.  I need to set the firts column (Emp_ID) as Primary Key (accomplished) and then generate a unique number for each Emp_ID that I insert.  currently I have no information in my database I'm stuck in finding the procedure to correctly code the SQL statement that will generate a unique Emp_ID when I insert new values or add a new row of information.  Can someone please help?  I&quot;ve look all over my text and searched the web and cannot find something useful to help.<br />
<br />
thanks in advance</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>kevlam</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228469.html</guid>
		</item>
		<item>
			<title>Help...! (Sub Query)</title>
			<link>http://www.daniweb.com/forums/thread228423.html</link>
			<pubDate>Wed, 07 Oct 2009 22:01:31 GMT</pubDate>
			<description><![CDATA[hi to all, 
 
this might be very simple, but i don;t know how to get correct output, someone help me to complete it... 
 
*1st i need to get result from this query* 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a...]]></description>
			<content:encoded><![CDATA[<div>hi to all,<br />
<br />
this might be very simple, but i don;t know how to get correct output, someone help me to complete it...<br />
<br />
<span style="font-weight:bold">1st i need to get result from this query</span><br />
 <pre style="margin:20px; line-height:13px">$sql=&quot;SELECT * FROM $tbl1_name WHERE sex='$show_all'&quot;;<br />
$result=mysql_query($sql);</pre>this'll result either all the boys or all the girls;<br />
<br />
<span style="font-weight:bold">from the above result again i need select according to their age using this 2nd query.</span><br />
 <pre style="margin:20px; line-height:13px">$sql=&quot;SELECT * FROM $tbl1_name WHERE age BETWEEN '$from' AND '$to'&quot;;<br />
$result=mysql_query($sql);</pre><br />
<br />
Help me to do this in single subquery...<br />
<br />
Thanx in advance...</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>nadnakinam</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228423.html</guid>
		</item>
		<item>
			<title>problem with highest date</title>
			<link>http://www.daniweb.com/forums/thread228334.html</link>
			<pubDate>Wed, 07 Oct 2009 13:38:58 GMT</pubDate>
			<description>hello im studying dba, right now im stuck with project i have to do. 
Here is what bothers me. 
i have 2 tables one with tasks and one with salarys. 
Task table describes who is working on what from when how many hours on so on. Salarys gives me info on how much ppl earn per hour and so on. Nothing...</description>
			<content:encoded><![CDATA[<div>hello im studying dba, right now im stuck with project i have to do.<br />
Here is what bothers me.<br />
i have 2 tables one with tasks and one with salarys.<br />
Task table describes who is working on what from when how many hours on so on. Salarys gives me info on how much ppl earn per hour and so on. Nothing strange so far.<br />
SO i started to calculate hours spend on task * salary per hour under chosen time period. ANd here comes the catch. Person recieved rise in salary and query automaticly adds 2 values of salary per hour on same project.<br />
 lets say 2008-01-01 salary was 100 and in 2008-05-01 120 those 2 records are in table with diff id.So i should have 213 hours spend on project but now i have 426 hours. Is there any way to chose highest salary with help of a date wich is correct to chosen time period ?<br />
lest say time period 2008-01-01 to 08-01-30 i can chose max(date) but i need some kind of statement that max date cant be higher then chosen time period. i was trying with<br />
<br />
 <pre style="margin:20px; line-height:13px">and cos_tasks.task_start_date between '2008-01-01' and '2009-08-30'<br />
and cos_salaries.salary_startdate &lt;= cos_tasks.task_start_date</pre><br />
problem is after this person got more salary andi change time period for longer one statement is true for 2 options so old salary and new salary are calculated.<br />
<br />
thank you.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>czekonq</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228334.html</guid>
		</item>
		<item>
			<title>including SP in dts package</title>
			<link>http://www.daniweb.com/forums/thread228295.html</link>
			<pubDate>Wed, 07 Oct 2009 10:54:31 GMT</pubDate>
			<description>While creating a DTS package i want to include a Stored Procedure with input parameters? Can any help in this.</description>
			<content:encoded><![CDATA[<div>While creating a DTS package i want to include a Stored Procedure with input parameters? Can any help in this.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>carobee</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228295.html</guid>
		</item>
		<item>
			<title>Recent Interview Question</title>
			<link>http://www.daniweb.com/forums/thread228081.html</link>
			<pubDate>Tue, 06 Oct 2009 15:44:55 GMT</pubDate>
			<description>I was asked Suppose there is table A in DB,Suppose when we update that table,whose are two tables(Magic tables) that are updated other than table A?</description>
			<content:encoded><![CDATA[<div>I was asked Suppose there is table A in DB,Suppose when we update that table,whose are two tables(Magic tables) that are updated other than table A?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>sonia sardana</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228081.html</guid>
		</item>
		<item>
			<title>How to create multiple tables</title>
			<link>http://www.daniweb.com/forums/thread228039.html</link>
			<pubDate>Tue, 06 Oct 2009 12:27:08 GMT</pubDate>
			<description>I want to create two tables with names group,phone 
group contains id,name,place,phone numbers 
phone contains id,phone numbers 
my query is that phone table should accept id and phone numbers that matches group table(id and phone numbers) can one please help me .</description>
			<content:encoded><![CDATA[<div>I want to create two tables with names group,phone<br />
group contains id,name,place,phone numbers<br />
phone contains id,phone numbers<br />
my query is that phone table should accept id and phone numbers that matches group table(id and phone numbers) can one please help me .</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>madhav089</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228039.html</guid>
		</item>
		<item>
			<title>how to record 3-digit zeros</title>
			<link>http://www.daniweb.com/forums/thread227984.html</link>
			<pubDate>Tue, 06 Oct 2009 07:29:43 GMT</pubDate>
			<description><![CDATA[Okay idk if it's possible but I want one of my fields to have 000 as a default value and to maintain this value whenever called for. Like if I use PHP to run a query that asks for that field I want it to return "000". I'm doing this coz I'm playing with version records here. 
 
OK so there's this...]]></description>
			<content:encoded><![CDATA[<div>Okay idk if it's possible but I want one of my fields to have 000 as a default value and to maintain this value whenever called for. Like if I use PHP to run a query that asks for that field I want it to return &quot;000&quot;. I'm doing this coz I'm playing with version records here.<br />
<br />
OK so there's this thing called Zerofill, but I want it a little different. I want this field to be able to store INTEGER(5), but default value &quot;000&quot;, a three-digit zeros. So if user do not enter any number, it will be &quot;000&quot;, but user MAY enter up to 5 digits....</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>AdventDeo</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227984.html</guid>
		</item>
		<item>
			<title>how to create table relate with other table</title>
			<link>http://www.daniweb.com/forums/thread227967.html</link>
			<pubDate>Tue, 06 Oct 2009 05:28:56 GMT</pubDate>
			<description>I am creating two tables with names group,phone  
group caontains id,name,place,phone numbers 
phone contains id,phone numbers   
my query is that phone table should accept  id and phone numbers that matches group table(id and phone numbers) can one please help me .</description>
			<content:encoded><![CDATA[<div>I am creating two tables with names group,phone <br />
group caontains id,name,place,phone numbers<br />
phone contains id,phone numbers  <br />
my query is that phone table should accept  id and phone numbers that matches group table(id and phone numbers) can one please help me .</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>madhav089</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227967.html</guid>
		</item>
		<item>
			<title>Search in string</title>
			<link>http://www.daniweb.com/forums/thread227811.html</link>
			<pubDate>Mon, 05 Oct 2009 14:12:51 GMT</pubDate>
			<description><![CDATA[Hi to All. 
I have this code: 
$query = " SELECT *FROM tabela WHERE persons LIKE '%$search%'For example I have row in persons column which contains "John William Smith"  
If I type in search filed "John William" or "William Smith" it will return result. But how to make to return result if I type...]]></description>
			<content:encoded><![CDATA[<div>Hi to All.<br />
I have this code:<br />
 <pre style="margin:20px; line-height:13px">$query = &quot; SELECT *FROM tabela WHERE persons LIKE '%$search%'</pre>For example I have row in persons column which contains &quot;John William Smith&quot; <br />
If I type in search filed &quot;John William&quot; or &quot;William Smith&quot; it will return result. But how to make to return result if I type &quot;John Smith&quot; in search box.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>ultras1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227811.html</guid>
		</item>
		<item>
			<title>Trigger????</title>
			<link>http://www.daniweb.com/forums/thread227687.html</link>
			<pubDate>Mon, 05 Oct 2009 04:27:58 GMT</pubDate>
			<description><![CDATA[I use mysql to store some time values (infact 2 at a time) 
Startime & end time....  in two columns. 
 
 I have another column called duration which stores the diffrerce of the above two time values...  
 
I want to fill that third column(duration) when I insert the values to the first 2 columns.....]]></description>
			<content:encoded><![CDATA[<div>I use mysql to store some time values (infact 2 at a time)<br />
Startime &amp; end time....  in two columns.<br />
<br />
 I have another column called duration which stores the diffrerce of the above two time values... <br />
<br />
I want to fill that third column(duration) when I insert the values to the first 2 columns..<br />
<br />
I think that can be done through a trigger.. how can I do that??<br />
(I dnt knw how to write a trigger...or wat it reallly does is!!!!!!)<br />
<br />
please help.....<br />
<br />
(I use java for the application. if this should be solved through java plz let me knw)</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jrosh</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227687.html</guid>
		</item>
		<item>
			<title>password for phpmyadmin</title>
			<link>http://www.daniweb.com/forums/thread227678.html</link>
			<pubDate>Mon, 05 Oct 2009 03:46:16 GMT</pubDate>
			<description>I want to set a password to *phpmyadmin interface* in WAMP.. 
How can I do that?? 
  
I jst want to make sure that no one will change my databases using  
Phpmyadmin GUI ..()  mysql console is ok..... 
 
thankx in advance..</description>
			<content:encoded><![CDATA[<div>I want to set a password to <span style="font-weight:bold">phpmyadmin interface</span> in WAMP..<br />
How can I do that??<br />
 <br />
I jst want to make sure that no one will change my databases using <br />
Phpmyadmin GUI ..()  mysql console is ok.....<br />
<br />
thankx in advance..</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jrosh</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227678.html</guid>
		</item>
		<item>
			<title>Beginning MySQL with Java</title>
			<link>http://www.daniweb.com/forums/thread227662.html</link>
			<pubDate>Mon, 05 Oct 2009 01:39:06 GMT</pubDate>
			<description><![CDATA[Hello everyone =)  I'm a Java programmer who wants to do work with databases.  MySQL seems to be a popular choice, but I don't know where to start.  I messed around with Derby, but I didn't really understand what was going on.  If anyone could point me in the direction of a good tutorial for MySQL...]]></description>
			<content:encoded><![CDATA[<div>Hello everyone =)  I'm a Java programmer who wants to do work with databases.  MySQL seems to be a popular choice, but I don't know where to start.  I messed around with Derby, but I didn't really understand what was going on.  If anyone could point me in the direction of a good tutorial for MySQL through Java, that would be awesome =)<br />
<br />
Thank you!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>llemes4011</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227662.html</guid>
		</item>
		<item>
			<title>help with mysql SELECT statement</title>
			<link>http://www.daniweb.com/forums/thread227511.html</link>
			<pubDate>Sun, 04 Oct 2009 01:11:41 GMT</pubDate>
			<description><![CDATA[how do i select a row in a table  columns i dont know the name of(and find the name of it)? but i know the cell/field of the  column has a  value of "55" 
i also have to EXCLUDE ONE COLUMN that i know the name of. 
 
does anyone know how to make the select statement that seleects all the columns...]]></description>
			<content:encoded><![CDATA[<div>how do i select a row in a table  columns i dont know the name of(and find the name of it)? but i know the cell/field of the  column has a  value of &quot;55&quot;<br />
i also have to EXCLUDE ONE COLUMN that i know the name of.<br />
<br />
does anyone know how to make the select statement that seleects all the columns with the value of 55. i only know the name of the column i want to exclude from the search.<br />
?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>SKANK!!!!!</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227511.html</guid>
		</item>
		<item>
			<title>create table problems</title>
			<link>http://www.daniweb.com/forums/thread227477.html</link>
			<pubDate>Sat, 03 Oct 2009 19:06:47 GMT</pubDate>
			<description><![CDATA[can someone help me identify the syntax error with this code 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags" target="_blank">Help...]]></description>
			<content:encoded><![CDATA[<div>can someone help me identify the syntax error with this code<br />
 <pre style="margin:20px; line-height:13px">CREATE&nbsp; TABLE IF NOT EXISTS Persons <br />
(&nbsp; id_number VARCHAR(13) NOT NULL <br />
&nbsp; &nbsp; ,&nbsp; name VARCHAR(45) NOT NULL <br />
&nbsp; &nbsp; ,&nbsp; name_2 VARCHAR(45) NULL <br />
&nbsp; &nbsp; ,&nbsp; name_3 VARCHAR(45) NULL <br />
&nbsp; &nbsp; ,&nbsp; surname VARCHAR(45) NOT NULL <br />
&nbsp; &nbsp; ,&nbsp; date_created DATE<br />
&nbsp; &nbsp; ,&nbsp; date_modified DATE<br />
&nbsp; &nbsp; ,&nbsp; PRIMARY KEY (id_number) <br />
&nbsp; &nbsp; ,&nbsp; INDEX per_id_fk (id_number ASC) <br />
&nbsp; &nbsp; ,&nbsp; INDEX per_stat_fk (id_number ASC) <br />
&nbsp; &nbsp; ,&nbsp; CONSTRAINT per_id_fk&nbsp; &nbsp; FOREIGN KEY (id_number )&nbsp; &nbsp; REFERENCES Person_Image (id_number )&nbsp; &nbsp; ON DELETE CASCADE&nbsp; &nbsp; ON UPDATE CASCADE<br />
&nbsp; &nbsp; ,&nbsp; CONSTRAINT per_stat_fk&nbsp; &nbsp; FOREIGN KEY (id_number )&nbsp; &nbsp; REFERENCES Current_Status (id_number )&nbsp; &nbsp; ON DELETE CASCADE&nbsp; &nbsp; ON UPDATE CASCADE<br />
)</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>baki100</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227477.html</guid>
		</item>
		<item>
			<title>finding the largest numbers</title>
			<link>http://www.daniweb.com/forums/thread227289.html</link>
			<pubDate>Fri, 02 Oct 2009 19:25:40 GMT</pubDate>
			<description><![CDATA[hi all 
could any 1 help me out. 
im trying to find the biggest id number in a db. 
the problem is that the "ID" column is saved as "TEXT"(its important to me). 
the language im using is PHP. 
10x! 
 
tried to use this but it didnt work 
  <div class="codeblock"> <div class="spaced"> <div...]]></description>
			<content:encoded><![CDATA[<div>hi all<br />
could any 1 help me out.<br />
im trying to find the biggest id number in a db.<br />
the problem is that the &quot;ID&quot; column is saved as &quot;TEXT&quot;(its important to me).<br />
the language im using is PHP.<br />
10x!<br />
<br />
tried to use this but it didnt work<br />
 <pre style="margin:20px; line-height:13px">$resultt = mysql_query(&quot;SELECT MAX(id) FROM object&quot; , $conn);<br />
$row = mysql_fetch_array($resultt);<br />
$num=$row[maxnum];</pre>[/code]</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>severman</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227289.html</guid>
		</item>
		<item>
			<title>Compare and update products pricing columns</title>
			<link>http://www.daniweb.com/forums/thread227195.html</link>
			<pubDate>Fri, 02 Oct 2009 09:35:13 GMT</pubDate>
			<description>Hi Guys  
 
Firstly: 
 
Is it possible to import two columns from an excel sheet into two new columns in a mysql database?  
 
I would like to import new product codes(prodcode2) and pricing(prodsupplyprice2) into these two columns and then set up a query to do the folowing... 
 
I need to compare...</description>
			<content:encoded><![CDATA[<div>Hi Guys <br />
<br />
Firstly:<br />
<br />
Is it possible to import two columns from an excel sheet into two new columns in a mysql database? <br />
<br />
I would like to import new product codes(<span style="color:Green">prodcode2</span>) and pricing(<span style="color:Green">prodsupplyprice2</span>) into these two columns and then set up a query to do the folowing...<br />
<br />
I need to compare original product codes column(<span style="color:Green">prodcode</span>) with the new imported product code column(<span style="color:Green">prodcode2</span>) and if the same code is present anywhere in the two columns, update the products price(<span style="color:Green">prodsupplyprice</span>) with the newly imported price(<span style="color:Green">prodsupplyprice2</span>). <br />
<br />
This becomes challange because most of the time the product codes are not lined up next to each other and are unordered.<br />
<br />
I figure you need to use a <span style="color:Green">SELECT</span> statement and <span style="color:Green">MATCH</span> statement to select the matching codes and maybe reorder (<span style="color:Green">prodcode2</span>) to line up with (<span style="color:Green">prodcode</span>)<br />
<br />
From there you just use the <span style="color:Green">UPDATE</span> statement to change the prices.<br />
<br />
How I see it:<br />
<br />
 <pre style="margin:20px; line-height:13px">SELECT * FROM products WHERE MATCH (prodcode) AGAINST (prodcode2);</pre>How? This doenst work, I have tried combinations and sometimes get a FULLTEXT error..? <br />
<br />
Then, need to somehow reorder corrisponding codes next to each other... How?<br />
<br />
Then<br />
 <pre style="margin:20px; line-height:13px">UPDATE `products` SET `prodsupplytprice` = (`prodsupplyprice2`) WHERE `prodsupplyprice2` &gt; 0 ;</pre><br />
Any help on this would be greatly appreciated and could save me HOURS updating prices... or if there is a better way of doing this please let me know :)<br />
<br />
Many Thanks<br />
Marc</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>mls880</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227195.html</guid>
		</item>
		<item>
			<title>Mysql query</title>
			<link>http://www.daniweb.com/forums/thread227190.html</link>
			<pubDate>Fri, 02 Oct 2009 09:20:57 GMT</pubDate>
			<description>Hai, 
 
I am developing a home appliances website. I had a detail database. Which stored the details of all the items in that shop. The columns are Id number, name, price, type, made, date. 
 
When user clicks on the TV menu in the website then the lists of TV in that shop will show. I did that...</description>
			<content:encoded><![CDATA[<div>Hai,<br />
<br />
I am developing a home appliances website. I had a detail database. Which stored the details of all the items in that shop. The columns are Id number, name, price, type, made, date.<br />
<br />
When user clicks on the TV menu in the website then the lists of TV in that shop will show. I did that using the mysql query like this<br />
<br />
 <pre style="margin:20px; line-height:13px">select * from data_base where type=&quot;TV&quot;;</pre><br />
Working fine. Now I need to do a filter search in this page. That is I need to show a list/menu in that page showing all the TV brands in that shop. <br />
How to display all the brands from a database like this <br />
<br />
Type----------------Brand----------------Model No<br />
TV----------------Sony	----------------510<br />
TV ----------------AKAI----------------120<br />
TV----------------Sony	----------------150<br />
TV----------------SAMSUNG----------------840<br />
TV ----------------Sony----------------170<br />
<br />
Simply I need to display all the tv brands without repeating the name. If I will use this query models will repeat<br />
<br />
 <pre style="margin:20px; line-height:13px">select &quot;Brand&quot; from data_base where type=&quot;tv&quot;;</pre><br />
ie the result will be like this<br />
<br />
Sony	<br />
AKAI<br />
Sony<br />
SAMSUNG<br />
Sony<br />
<br />
But I want a result like this<br />
<br />
Sony<br />
AKAI<br />
SAMSUNG<br />
<br />
<br />
Thanks in advance<br />
Rajeesh</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>rajeesh_rsn</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227190.html</guid>
		</item>
		<item>
			<title>retrieve the last record???</title>
			<link>http://www.daniweb.com/forums/thread227186.html</link>
			<pubDate>Fri, 02 Oct 2009 09:15:13 GMT</pubDate>
			<description>How to write a query to retrieve the *last record* that is entered. ???</description>
			<content:encoded><![CDATA[<div>How to write a query to retrieve the <span style="font-weight:bold">last record</span> that is entered. ???</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum126.html">MySQL</category>
			<dc:creator>jrosh</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227186.html</guid>
		</item>
	</channel>
</rss>
