|
2
|
Other Software / Developer's Corner / Re: SQlite + Php 5.2.9 + Apache2.2
|
on: July 21, 2009, 01:24:48 AM
|
If it doesn't exist yet, perhaps a CREATE DATABASE DEVDB where DEVDB is the name of the database...
With this line if the DB file does not exist it will create and open it. If it does exist it will open it. sqlite_open('jx3.db', 0666, $sqliteerror)
|
|
|
|
|
3
|
Other Software / Developer's Corner / Re: SQlite + Php 5.2.9 + Apache2.2
|
on: July 21, 2009, 01:21:13 AM
|
Everywhere I have looked says it is supported and it works without the "IF NOT EXISTS". There is the rest of the code - some columns I am using the try catch in replace of the "IF NOT EXISTS"  and it works without the "IF NOT EXISTS" [ copy or print] $mysql = "CREATE TABLE startup (row_id INTEGER PRIMARY KEY, "; $mysql .= "games TEXT NOT NULL, "; $mysql .= "user_id TEXT NOT NULL, "; . . . . $mysql .= "age TEXT "; . . $mysql .= "); "; if ($db = sqlite_open('jx3.db', 0666, $sqliteerror)) { //catch if database is already there try{ sqlite_query($db,$mysql); } catch(Exception $e){ } $mysql = "INSERT INTO startup (games,user_id,age"; . . . . $mysql .= ") VALUES (\""; $mysql .= $var_games . "\",\"" .$var_id . "\",\""; . . . . $mysql .= $var_age . "\")"; sqlite_query($db, $mysql) or die("Error in query: ".sqlite_error_string(sqlite_last_error($db))); But when I use the "IF NOT EXISTS" it gives me a error  I do not understand why?? [ copy or print] $mysql = "CREATE TABLE IF NOT EXISTS startup (row_id INTEGER PRIMARY KEY, "; $mysql .= "games TEXT NOT NULL, "; $mysql .= "user_id TEXT NOT NULL, "; . . . . $mysql .= "age TEXT "; . . $mysql .= "); "; if ($db = sqlite_open('jx3.db', 0666, $sqliteerror)) { sqlite_query($db,$mysql); $mysql = "INSERT INTO startup (games,user_id,age"; . . . . $mysql .= ") VALUES (\""; $mysql .= $var_games . "\",\"" .$var_id . "\",\""; . . . . $mysql .= $var_age . "\")"; sqlite_query($db, $mysql) or die("Error in query: ".sqlite_error_string(sqlite_last_error($db)));
|
|
|
|
|
4
|
Other Software / Developer's Corner / SQlite + Php 5.2.9 + Apache2.2
|
on: July 19, 2009, 09:20:10 PM
|
|
Can someone please help me with sqlite.
I am using SQlite + Php 5.2.9 + Apache2.2.
I can create a table using "CREATE TABLE startup (row_id INTEGER PRIMARY KEY"
But when I try to use "CREATE TABLE startup IF NOT EXISTS (row_id INTEGER PRIMARY KEY" or "CREATE TABLE IF NOT EXISTS startup (row_id INTEGER PRIMARY KEY" I am getting this error.
"Error in query: SQL logic error or missing database"
Does anyone know if the "IF NOT EXISTS" statement can be used with SQlite, Php 5.2.9 + Apache2.2. or is there an other way of checking if a table does exists before trying to create it.
|
|
|
|
|
6
|
Other Software / Developer's Corner / Help C# ASPX Database/dropdown error
|
on: May 18, 2009, 01:39:56 AM
|
I have a drop Download list that is being filled from a database: My ASPX.cs file [ copy or print] myDataAdapter.Fill(myDataSet, "country,country_id"); DropDownList1.DataSource = myDataSet; DropDownList1.DataValueField = "country_id"; DropDownList1.DataTextField = "country"; DropDownList1.DataBind(); my APSX File [ copy or print] <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"> </asp:DropDownList><br /><br /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> Adderss: label stuff Adderss: label stuff </ContentTemplate> <Triggers> trigger stuff </Triggers> </asp:UpdatePanel> when I select something from the drop down list a access the database again but no matter how many items are in the dropdown I get return a value of 1 from this code My ASPX.cs file [ copy or print] database stuff int place = Convert.ToInt32(DropDownList1.SelectedValue); String strSQL = database select using place Can someone please help me?
|
|
|
|
|
7
|
Other Software / Developer's Corner / Re: PHP Database help.
|
on: May 13, 2009, 08:10:02 PM
|
How far did you look until you came to that conclusion?
I have spend two days four days before posting this topic and an other two day after posting it just trying to find out this first part. "Drop down box 1 will be filled from Table 1 (subject) Drop down box 2 is filled from Table 2 based on what subject is selected in Drop down box 1" Note: I am trying to do this first part on one page. I have already found a way I can do this with ASPX using updatepanel but I have not coded it yet, as I am now trying to work out now to connect ASPX using C# to a database. This is proving to be harder in C# and ASPX.
|
|
|
|
|
9
|
Other Software / Developer's Corner / PHP Database help.
|
on: May 11, 2009, 11:05:53 PM
|
|
I am trying to create a php page that has 2 drop down lists and a search box, the drop down list are filled via database.
for exmlpe My database can be something like.
Table 1 Subject ID Subject
Table 2 Subject ID paper ID Paper
Table 3 Subject ID Paper ID Title Des
Drop down box 1 will be filled from Table 1 (subject) Drop down box 2 is filled from Table 2 based on what subject is selected in Drop down box 1 when a search word is entered into the search box then table 3 is searched based on the search box and what is selected in down down boxes 1 and 2 the search result is displayed in a different page as links, the link when clicked displays the Full record that is in table 3.
Can someone please tell me how to or help me do this?
Thanks
|
|
|
|
|
10
|
Other Software / C / C++ / Re: Static Text Control Font Size
|
on: March 03, 2009, 11:38:53 PM
|
Hi Again Just to let you know I did it in three lines of code. Formatted for C++ with the GeSHI Syntax Highlighter [ copy or print] CFont *m_Word = new CFont; m_Word->CreatePointFont(600, _T("Arial") ); C_Word.SetFont(m_Word); //C_Word is a control variable for the Static text control
I thought there is a easy way to do it just did not know how, Thanks again for your help.
|
|
|
|
|
11
|
Other Software / C / C++ / Re: Static Text Control Font Size
|
on: March 03, 2009, 09:03:49 AM
|
Hi, I got it to build. I did it by adding a control variable called C_word to the Static text control and the removing the following two lines and adding this one. Formatted for C++ with the GeSHI Syntax Highlighter [ copy or print] //CWnd *wndControl = GetDlgItem(IDC_Word); //wndControl.SetFont(font_fixedw_,TRUE); C_Word.SetFont(&font_fixedw_);
However are text does not seem to get bigger. I will keep playing with it. Thanks for your Help.
|
|
|
|
|
12
|
Other Software / C / C++ / Re: Static Text Control Font Size
|
on: March 03, 2009, 06:45:16 AM
|
Hi, I have tried these two lines in different ways including the ways below. Formatted for C++ with the GeSHI Syntax Highlighter [ copy or print] CWnd *wndControl = GetDlgItem(IDC_Word); wndControl.SetFont(font_fixedw_); CWnd wndControl = new CWind; wndControl = GetDlgItem(IDC_Word); wndControl.SetFont(font_fixedw_); CWnd wndControl = GetDlgItem(IDC_Word); wndControl.SetFont(font_fixedw_); CWnd *wndControl = GetDlgItem(IDC_Word); wndControl->SetFont(font_fixedw_);
All of them seem to give me a error. Not sure what to do now.
|
|
|
|
|
13
|
Other Software / C / C++ / Re: Static Text Control Font Size
|
on: March 03, 2009, 03:49:51 AM
|
Hi If I change your code to this I only get one error, which I am not sure on how to fix. Formatted for C++ with the GeSHI Syntax Highlighter [ copy or print] CFont font_fixedw_; . . . LOGFONT lf; lf.lfWidth = 6; lf.lfPitchAndFamily = FIXED_PITCH; lf.lfFaceName[0] = 0; font_fixedw_.CreateFontIndirect(&lf); CWnd *wndControl = GetDlgItem(IDC_Word); wndControl.SetFont(font_fixedw_); //Error Error C2228: left of '.SetFont' must have class/struct/union
|
|
|
|
|
14
|
Other Software / C / C++ / Static Text Control Font Size
|
on: March 03, 2009, 02:28:22 AM
|
|
Hi,
Can some one please tell me a easy way to make these to static text label controls in MFC, MS Visual Studio have a larger text font.
I would like.
IDC_Words to have a font size of 70. IDC_Answer to have a font size of 50.
I have tried GetDlgItem(IDC_Word)->SetWindowTextW(); and IDC_Answer::FONTSIZE(50); but both do not work.
Thanks
|
|
|
|
|
16
|
Other Software / Developer's Corner / Visual C++ Help please (Vector<>)
|
on: February 20, 2009, 02:56:55 AM
|
OK I have written this small program that helps me learn Chinese and it works in C++ but I want to have a GUI for it current no GUI, So I am transferring it over to Visual C++ making changes as I need too. I have come to a problem with my Vectors. Error Formatted for C++ with the GeSHI Syntax Highlighter [ copy or print] errorC2923:'std::vector' : 'words' is not a vaild template type argument for parameter '_Ty'
the error is happening here. Formatted for C++ with the GeSHI Syntax Highlighter [ copy or print] // Chinese learning.cpp : main project file. #include "stdafx.h" #include "Form1.h" #include "words.h" #include <vector> #include <string> #include <fstream> using namespace Chineselearning; //functions void split(std::string, std::vector<std::string>&); int checkword(std::vector<words>&, std::string); void getword(std::vector<words>&, std::string); void getfile(std::vector<words>&, std::vector<words>&); //void outfile(std::vector<words>&, std::vector<words>&); void print(std::vector<words>&); int getrand(int); void display(std::vector<words>&); // TODO: Add extra initialization here std::vector<words> vecWords; std::vector<words> vecWordsTemp; std::vector<std::string> words; int input = 0; int index = 0; std::string lineIn; //start [STAThreadAttribute] int main(array<System::String ^> ^args) { // Enabling Windows XP visual effects before any controls are created Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); // Create the main window and run it Application::Run(gcnew Form1()); getfile(vecWords, vecWordsTemp); return 0; } //ERROR happening on this line std::vector<words>& vecTemp int checkword(std::vector<words>& vecTemp, std::string word) { int index = -1; if(vecTemp.size() != 0) { for(std::vector<int>::size_type ix = 0; ix != vecTemp.size(); ++ix) { if(vecTemp[ix].getNewWord() == word) { return ix; }//end if }//end forloop }//end if return index; }//end checkword
words is a class not a template. I am also getting some other error message that I have not looked at yet. As I am learning Visual C++ please do not change the code and send it back to me. I would like to know what I am doing wrong and How to fix it. Thanks.
|
|
|
|
|
17
|
Main Area and Open Discussion / Living Room / Re: eBay USB Thumb Drive Buyers: Beware
|
on: January 16, 2009, 02:57:02 AM
|
|
We get a lot of that here in china, in fact we see so much of it here that the XPATs here think it is a big joke now. We can normally tell when someone is selling fake stuff.
Rule One: If it is not sold in the regular shops then I leave it alone. Rule Two: If it is cheap there is a reason why.
Josh: nice photo, remains me of some stuff they sell in gongbei the Fate market in my area. hehe
|
|
|
|
|
18
|
Main Area and Open Discussion / Living Room / Re: What may you be missing?
|
on: January 13, 2009, 08:35:10 PM
|
Thanks for posting this but I think they are missing some points here too. - Did the people in the subway like this kind of music, If not they would not stop and listen.
- Did they know who this person was, most people may not know who he is.
- Do most people know what a violin worth 3.5 million dollars looks like.
I think if he played in a upmarket area, where people that can afford a $100 ticket to watch some one playing a violin, would normal go then the reaction would be different.
|
|
|
|
|
21
|
Other Software / Developer's Corner / Check boxes
|
on: January 08, 2009, 03:15:17 AM
|
|
Ok I have a small problem.
I need the text on the second line of each checkbox to line up with the first line, I have tried using a div but it just puts the text on the line below and I do not want to use the space &nbs... command.
Does anyone have any ideas or will I have to use the space code.
Checkbox this is the text here that is over two lines Checkbox this is the text here that is over two lines Checkbox this is the text here that is over two lines
|
|
|
|
|
22
|
Main Area and Open Discussion / Living Room / Re: GPS and Google earth
|
on: December 31, 2008, 09:31:38 AM
|
|
Hi tsaint How is the Office software going?
Thanks to both of you I am on my way to Shaoguan now and I will back on the 4th so I will check these out next week.
4wd I do not mind getting a mapping GPS but as I am new to all this I would need an easy to use mapping GPS.
|
|
|
|
|