Topics - Davidtheo [ switch to compact view ]

Pages: [1] 2 3next
1
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.

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

3
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

4
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

5
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.

Pages: [1] 2 3next
Go to full version