User Profile

Collapse

Profile Sidebar

Collapse
thatos
thatos
Last Activity: Oct 25 '11, 06:36 PM
Joined: Aug 18 '07
Location: SOUTH AFRICA
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • thatos
    replied to Handling Decimal format
    When I do that, the table is not created, look at the code below.
    Code:
    $Isotope = "CREATE TABLE Isotope (
    	isotope_id int(2) NOT NULL auto_increment,
    	isotope_name varchar(50) NOT NULL,
    	state int(1) NOT NULL,
    	unit varchar(10) NOT NULL,
    	min_value decimal(3,6) NOT NULL,
    	max_value decimal(3,6) NOT NULL,
    	PRIMARY KEY (isotope_id)
    )";
    $results = mysql_query($Isotope);
    See more | Go to post

    Leave a comment:


  • thatos
    started a topic Handling Decimal format

    Handling Decimal format

    I have the following create statement
    Code:
    $query = "CREATE TABLE P(
     code int(2) NOT NULL,
     value decimal(3.6) NOT NULL,
     PRIMARY KEY(code)
    
    ";
    but when I look at the data field using phpadmin, value is (3.0) , and when I insert a value say "123.123456 " this number gets converted to 123.

    I just want to know how to represent a decimal in an sql statement...
    See more | Go to post

  • thatos
    started a topic Input being converted to integers in form array
    in PHP

    Input being converted to integers in form array

    I have the following code in an html form
    Code:
    <input type="text" name = 'ions[1]'>
    <input type="text" name = 'ions[2]'>
    <input type="text" name = 'ions[3]'>
    The form is then posted to an php function which does the following
    Code:
    foreach($ions as $ion_id =>  $value){
      echo $ion_id . " " . $value;
    }
    The above returns incorrect...
    See more | Go to post
    Last edited by Niheel; Oct 18 '11, 06:22 PM.

  • thatos
    replied to Using PHP and MySQL query results.
    in PHP
    Or it this possible.
    Code:
    $query = "(select s,m from R left join select s,n from P where R.s = P.s) left join select s,p from A where ?.s = A.s";
    See more | Go to post

    Leave a comment:


  • thatos
    replied to Using PHP and MySQL query results.
    in PHP
    But for ease of use can't I just have different statements and then concatenate those strings to form the final query?
    See more | Go to post

    Leave a comment:


  • thatos
    replied to OutOf MemoryError
    in Java
    You can try catching the Exception
    e.g
    Code:
    try{
      //Your Code
    }catch(OutOfMemoryError e){
      //Display Cannot Display Message
    }
    See more | Go to post

    Leave a comment:


  • thatos
    started a topic Using PHP and MySQL query results.
    in PHP

    Using PHP and MySQL query results.

    I have two results which I got after performing two and I want to left join those two tables, will this work. e.g.

    [CODE]
    $query1 = "select sample__code, location from sample";
    $query2 = "select sample_code, value from ion_data where ion_id = 1";
    $result1 = mysql_query($qu ery1);
    $result2 = mysql_query($qu eyr2);

    //How do I perform a left join between the two

    ...
    See more | Go to post

  • thatos
    started a topic Array of structures in C
    in C

    Array of structures in C

    I'm trying to create a structure which has an integer and a pointer to the same type. So I created a structure of that type but I seem to be printing wrong values.
    Code:
    #include <stdio.h>
    #include <string.h>
    #define max 20
    struct node{
    	int i;
    	struct node *next;
    };
    void print(struct node*);
    
    int main(){
    	struct node* b= (struct node*) malloc(sizeof(struct
    ...
    See more | Go to post

  • thatos
    replied to Print all suffix of String in C
    in C
    Thanks but what if I don't know the maximum length of the string?
    See more | Go to post

    Leave a comment:


  • thatos
    started a topic Print all suffix of String in C
    in C

    Print all suffix of String in C

    I have a string S and I want to print all its suffix, I tried the following but I seem to be missing a number of letters;
    Code:
    char *S;
    scanf("%s", &S);
    int l,i;
    l = strlen(S);
    for(i = 0;i < l;i++){
      printf("%s",&S[i]);
    }
    When I input a word of length greater the 8, I lose all the letters after the 8th char.
    for example
    Code:
    mississippi
    ...
    See more | Go to post

  • thatos
    started a topic warning: assignment from incompatible pointer type
    in C

    warning: assignment from incompatible pointer type

    I have the following code
    Code:
    typedef struct _DoublyLinkedNode {
        int value;
        struct _DoublyLinkedNode *next;
        struct _DoublyLinkedNode *prev;
    }DoublyLinkedNode;
    
    typedef struct DoublyLinkedList {
        int size;
        struct DoublyLinkedNode *firstnode;
        struct DoublyLinkedNode *lastnode;
    }list;
    
    
    list *p;
    
    int main(){
    ...
    See more | Go to post

  • thatos
    started a topic Java Threads
    in Java

    Java Threads

    if I have the following class
    Code:
    public class p1 extends Threads{
     public static main void(){
      run();
      run();
     }
     static void run(){
      //Code here
     }
    
    }
    When I run the above class, will it be threaded or not, or do I have to create another class to handle threads?
    See more | Go to post

  • thatos
    replied to How to connect to MS Access?
    in Java
    I have added the database to data source, and the code works.
    See more | Go to post

    Leave a comment:


  • thatos
    started a topic How to connect to MS Access?
    in Java

    How to connect to MS Access?

    I have the following code but its unable to connect to the database.

    Code:
    import java.sql.*;
    import javax.sql.*;
    
    public class firstD {
    
    	/**
    	 * @param args
    	 */
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		String caller;
    		String product;
    		
    		String query = "SELECT * FROM tblEmployee";
    ...
    See more | Go to post

  • thatos
    replied to Passing a 2-dimensional array as an argument
    in C
    Thanks for your help. Will it make it an easy if I new the maximum dimensions of that array?
    See more | Go to post

    Leave a comment:


  • thatos
    started a topic Passing a 2-dimensional array as an argument
    in C

    Passing a 2-dimensional array as an argument

    I would like to know how do I pass a 2-dimensional array as an argument to a funtion, if I will only know the size in runtime.
    See more | Go to post

  • thatos
    started a topic C++ converting string to a float
    in C

    C++ converting string to a float

    I have this line of code in my program
    Code:
    string line = "1";
    I would like to convert line into a float, now I can't use
    Code:
    float i = atof(line)
    because atof() takes in char * as its argument.
    Does someone know how can I convert a string into a float or at least convert type string to char * then use atof().
    See more | Go to post

  • thatos
    replied to Using C to call other programs
    in C
    Thanks to Josh

    I tried that line of code and it works, thank you.
    See more | Go to post

    Leave a comment:


  • thatos
    started a topic Using C to call other programs
    in C

    Using C to call other programs

    I have a java class exe.class I would like to call this program using c.
    I tried the following methods none of them seems to work if you know where the problem is please help.
    Code:
    main(){[INDENT]System("java C:/Users/sthato/workspace/NumThe/bin/exe");[/INDENT][INDENT]execlp("java","C:/Users/sthato/workspace/NumThe/bin/exe");[/INDENT][INDENT]execlp("C:/Program Files/Java/jdk1.6.0_07/bin/java.exe","C:/Users/sthato/workspace/Nu[/]
    ...
    See more | Go to post

  • thatos
    replied to A program to reverse a string.
    in C
    Why should I make it return an integer, I often see this in other peoples programs? Whats the importance of returning an integer?...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...