vista 0 Newbie Poster

I have everything setup. I just need the codes that do the copying. Assuming that the values entered are stored like this:

$values["user_id"]
$values["password"]

Attribute user_id is a primary key.

--
-- Table structure for table `logins`
--

CREATE TABLE `logins` (
  `id` varchar(50) NOT NULL default '',
  `password` varchar(50) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `user_id` varchar(50) NOT NULL default '',
  `password` varchar(50) default NULL,
  `full_name` varchar(50) default NULL,
  `nationality` varchar(50) default NULL,
  `govt_id` int(11) default NULL,
  `email` varchar(50) default NULL,
  `traffic_status` varchar(50) default NULL,
  `traffic_points` int(11) default NULL,
  PRIMARY KEY  (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
vista 0 Newbie Poster

Hi there.

Okay heres the scenario. I have 2 tables "Logins" and "User_Details"
What I want to do is write a PHP query that whenever a new user is created, that is manually entered into "User_details" table using a form, the next thing that should happen is that it should copy the value of the first 2 attributes from user_details table which are user_id and password into "Logins" table having the same 2 attributes only.

So what is the correct PHP query code for this. I tried many things but failed. I need somebody whos good at php / mysql to help me out! :)

Thanks!

vista 0 Newbie Poster

Thanks I tried that it gives me invalid operands for line 12 in the above code.

I understood the way it works, but when writing the code, its not doing what its supposed to.

I think the problem is with this

countlist RESB 26

is it an array?

cant I declare it as

countlise    dword 26 dup (?)
vista 0 Newbie Poster

Thanks but I am sorry that code does not work in my program. Its MASM and .686 model . and 32 bit.

I dont think those are the commands I use.

Anyways why 26 length array? and

what does this line do?

MOV DL,[countlist+EAX]

vista 0 Newbie Poster

Okay so I working on this program where I have to input a string and then display the character distribution in that string.

For example:
if the input is “minecode” the output should be

C – 1

O – 1

D – 1

E – 2

I – 1

M – 1

N – 1


here is what I tried to do but I really don't know how to traverse the loop and check for similar character and then increment the count. Please help me out! The assenbler is MASM 6.15 running on 32 bit machine.

.686
.MODEL flat, stdcall
.STACK
INCLUDE Irvine32.inc
.DATA

msg0 BYTE "Enter a string of characters: ",0
msg1 BYTE "Character Distribution: ",0

MainArray    dword 10000 dup (?)
UniqueChar   dword 10000 dup (?)
CharCount    dword 10000 dup (?)
.CODE
MAIN PROC
    lea edx, msg0
    call WriteString
    call dumpregs        ; 1
    call ReadString
    mov MainArray, eax
    call dumpregs        ; 2
    mov MainArray, ebx
    call dumpregs        ; 3
    call CRLF
    lea edx, msg1
    call WriteString
    call CharDist        ; Calls the procedure
    call dumpregs        ; 5
    exit
MAIN ENDP

CharDist PROC
    mov ecx, lengthof MainArray
    mov esi, OFFSET MainArray

    L1:

; what to do here?? 

Loop L1:


CharDist ENDP

END MAIN
vista 0 Newbie Poster

What changes would this have to be made if it was to run on 8086 assembly?

.686
.MODEL flat, stdcall
.STACK

.DATA

...


I am trying to run it...but no luck! The exe file after compiling just crashes!