no way out with this

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
lisawebs
Forum Commoner
Posts: 44
Joined: Wed Nov 19, 2003 6:21 pm

no way out with this

Post by lisawebs »

After a WEEK I can't make a simple/single record write/read,
I place example and code at: http://www.usa21.net/lisawebs_demo.php
there's also a link for the whole PHP code.

Please "for mercy!!!" someone take a look!
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Just a quick note: take the database-details out of the text-file you display unless you want someone to mess it up.
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post by microthick »

lisa, your code is really nice looking though. i'm sure the error is small.

i've never seen someone handle inserts and updates with the syntax you do.
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

Holy Shananagins!

Where did you learn to code?

I've never seen anyone write php like this ...

Like using trinary operators in QBasic ..

I think I'm going to adapt your style, I like it. My foo is weak ..

Don't suppose your message popup javascript could be wrong, I mean you did check it in the database right? I assume you would, just making sure.

other than that, i gotta study this a bit more, lol :lol:
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

Ok, just checking here.. but..

Code: Select all

if (isset($_POSTї'opcode'])) {
   $opcode = $_POSTї'opcode'];
   if ($opcode > 6){
         $flag = 1;
}  }
May be try taking that $opcode = $_POST thing out of the if. for some reason, php never lets me at least access the $_POST and $_GET vars in functions, I always have to assign them to variables first and then test those.

Also: do you realize you are passing a php variable (opcode) to the script with a hidden value of 0 ? Is that supposed to be right?

Still trying to figure this out. Your code is easy to read but hard to understand, lol.
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post by microthick »

lisa, ive never used the REPLACE sql command before, but it sounds like your table must have a primary key for it to work properly.

i know you do have an auto increment field, but when you created the table, did you make that field also the primary key?
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

Have you ran your SQL queries on your database to see if they are right?
Post Reply