topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 12:30 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Davidtheo [ switch to compact view ]

Pages: [1] 2 3 4 5next
1
Developer's Corner / Re: SQlite + Php 5.2.9 + Apache2.2
« on: July 21, 2009, 01:25 AM »
please help

2
Developer's Corner / Re: SQlite + Php 5.2.9 + Apache2.2
« on: July 21, 2009, 01:24 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
Developer's Corner / Re: SQlite + Php 5.2.9 + Apache2.2
« on: July 21, 2009, 01:21 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"

$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??

$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
Developer's Corner / SQlite + Php 5.2.9 + Apache2.2
« on: July 19, 2009, 09:20 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.

5
Developer's Corner / Re: PHP Database help.
« on: May 24, 2009, 08:22 PM »
OK How would this be done in PHP???? IF I can do this in PHP I do not need to change my server account to MS.

6
Developer's Corner / Help C# ASPX Database/dropdown error
« on: May 18, 2009, 01:39 AM »
I have a drop Download list that is being filled from a database:

My ASPX.cs file
        myDataAdapter.Fill(myDataSet, "country,country_id");

        DropDownList1.DataSource = myDataSet;
        DropDownList1.DataValueField = "country_id";
        DropDownList1.DataTextField = "country";
        DropDownList1.DataBind();

my APSX File
<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
database stuff
        int place = Convert.ToInt32(DropDownList1.SelectedValue);
        String strSQL = database select using place

Can someone please help me?

7
Developer's Corner / Re: PHP Database help.
« on: May 13, 2009, 08:10 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.

8
Developer's Corner / Re: PHP Database help.
« on: May 13, 2009, 12:00 AM »
ok It looks this this can't be done in PHP so I am now looking at ASPX, can anyone help he with this?

9
Developer's Corner / PHP Database help.
« on: May 11, 2009, 11:05 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
C / C++ / Re: Static Text Control Font Size
« on: March 03, 2009, 11:38 PM »
Hi Again

Just to let you know I did it in three lines of code.

Code: C++ [Select]
  1. CFont *m_Word = new CFont;
  2. m_Word->CreatePointFont(600, _T("Arial") );
  3. 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
C / C++ / Re: Static Text Control Font Size
« on: March 03, 2009, 09:03 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.

Code: C++ [Select]
  1. //CWnd *wndControl  = GetDlgItem(IDC_Word);
  2. //wndControl.SetFont(font_fixedw_,TRUE);
  3.  
  4. 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
C / C++ / Re: Static Text Control Font Size
« on: March 03, 2009, 06:45 AM »
Hi,

I have tried these two lines in different ways including the ways below.

Code: C++ [Select]
  1. CWnd *wndControl = GetDlgItem(IDC_Word);
  2. wndControl.SetFont(font_fixedw_);
  3.  
  4. CWnd wndControl = new CWind;
  5. wndControl = GetDlgItem(IDC_Word);
  6. wndControl.SetFont(font_fixedw_);
  7.  
  8. CWnd wndControl = GetDlgItem(IDC_Word);
  9. wndControl.SetFont(font_fixedw_);
  10.  
  11. CWnd *wndControl = GetDlgItem(IDC_Word);
  12. wndControl->SetFont(font_fixedw_);

All of them seem to give me a error. Not sure what to do now.


13
C / C++ / Re: Static Text Control Font Size
« on: March 03, 2009, 03:49 AM »
Hi

If I change your code to this I only get one error, which I am not sure on how to fix.

Code: C++ [Select]
  1. CFont font_fixedw_;
  2. .
  3. .
  4. .
  5. LOGFONT lf;
  6. lf.lfWidth = 6;
  7. lf.lfPitchAndFamily = FIXED_PITCH;
  8. lf.lfFaceName[0] = 0;
  9. font_fixedw_.CreateFontIndirect(&lf);
  10.        
  11. CWnd *wndControl = GetDlgItem(IDC_Word);
  12. wndControl.SetFont(font_fixedw_); //Error Error C2228: left of '.SetFont' must have class/struct/union


14
C / C++ / Static Text Control Font Size
« on: March 03, 2009, 02:28 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

15
Developer's Corner / Re: Visual C++ Help please (Vector<>)
« on: February 20, 2009, 06:20 AM »
Hi Eoin,

Thanks for your help  :Thmbsup:

16
Developer's Corner / Visual C++ Help please (Vector<>)
« on: February 20, 2009, 02:56 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
Code: C++ [Select]
  1. errorC2923:'std::vector' : 'words' is not a vaild template type argument for parameter '_Ty'


the error is happening here.

Code: C++ [Select]
  1. // Chinese learning.cpp : main project file.
  2.  
  3. #include "stdafx.h"
  4. #include "Form1.h"
  5. #include "words.h"
  6. #include <vector>
  7. #include <string>
  8. #include <fstream>
  9.  
  10. using namespace Chineselearning;
  11.         //functions
  12.         void split(std::string, std::vector<std::string>&);
  13.         int checkword(std::vector<words>&, std::string);
  14.         void getword(std::vector<words>&, std::string);
  15.         void getfile(std::vector<words>&, std::vector<words>&);
  16.         //void outfile(std::vector<words>&, std::vector<words>&);
  17.         void print(std::vector<words>&);
  18.         int getrand(int);
  19.         void display(std::vector<words>&);
  20.  
  21.         // TODO: Add extra initialization here
  22.         std::vector<words> vecWords;
  23.         std::vector<words> vecWordsTemp;
  24.         std::vector<std::string> words;
  25.     int input = 0;
  26.     int index = 0;
  27.         std::string lineIn;
  28.        
  29.         //start
  30.        
  31. [STAThreadAttribute]
  32. int main(array<System::String ^> ^args)
  33. {
  34.         // Enabling Windows XP visual effects before any controls are created
  35.         Application::EnableVisualStyles();
  36.         Application::SetCompatibleTextRenderingDefault(false);
  37.  
  38.         // Create the main window and run it
  39.         Application::Run(gcnew Form1());
  40.  
  41.         getfile(vecWords, vecWordsTemp);
  42.         return 0;
  43. }
  44. //ERROR happening on this line std::vector<words>& vecTemp
  45. int checkword(std::vector<words>& vecTemp, std::string word)
  46. {
  47.  int index = -1;
  48.  if(vecTemp.size() != 0)
  49.  {
  50.   for(std::vector<int>::size_type ix = 0; ix != vecTemp.size(); ++ix)
  51.   {
  52.    if(vecTemp[ix].getNewWord() == word)
  53.    {
  54.    return ix;
  55.    }//end if                              
  56.   }//end forloop
  57.  }//end if
  58.  return index;    
  59. }//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
Living Room / Re: eBay USB Thumb Drive Buyers: Beware
« on: January 16, 2009, 02:57 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
Living Room / Re: What may you be missing?
« on: January 13, 2009, 08:35 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.


 

19
Developer's Corner / Re: Check boxes
« on: January 08, 2009, 05:59 AM »
Thanks I did not think of using a table.  :-[ I will try it.  :Thmbsup:

20
Developer's Corner / Re: Check boxes
« on: January 08, 2009, 03:17 AM »
And one more thing I do not have any more room so the text can not be on one line.

and this in HTM code

21
Developer's Corner / Check boxes
« on: January 08, 2009, 03:15 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
Living Room / Re: GPS and Google earth
« on: December 31, 2008, 09:31 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.

23
Living Room / Re: Happy New Year, DC, and watch out for fire hazards!
« on: December 31, 2008, 09:23 AM »


Happy New Year All I hope all your hope and dreams come true in 2009.


24
You guys are so ambitious. I'm jealous. I've saved all year and by Spring 2009 I should have enough money to buy a [


Why pay 69.95 I can get you a bucket for 5.00 plus postage.

 

25
Living Room / Re: GPS and Google earth
« on: December 31, 2008, 01:29 AM »
Thanks 4WD and everyone.

I think my best bet is to go for the Nokia E71 Cell phone and the Bluetooth GPS Logger Fob or a Garmin Geko 201


Pages: [1] 2 3 4 5next