werushka Posted March 26, 2007 Share Posted March 26, 2007 I have this teacher and he is giving me realllllllyyyy hard time ??? ??? ??? I don't even know if it is possible to do that.. Here it goes I have index.php page and i have a database x securely connected to the index.php. The thing is I have to enter 2 numbers to 2 different database field (exmaple 1 in one fields and 8 to the other field) when the visitor enters to the index.php a number between 1 to 8 should be generated automatically and be posted on the field. in index.php. And after the user lets say sees number 6 and press submit it is entered to the database in another field. I really have no idea how to do this it supposed to be 101 class. anyway any help would really be appreciated. thanks a lot in advance. Link to comment https://forums.phpfreaks.com/topic/44427-php-i-have-no-idea/ Share on other sites More sharing options...
MadTechie Posted March 26, 2007 Share Posted March 26, 2007 first get it writing to 1 database, repeat the whole thing again (new connection string) for the 2nd database Link to comment https://forums.phpfreaks.com/topic/44427-php-i-have-no-idea/#findComment-215741 Share on other sites More sharing options...
werushka Posted March 26, 2007 Author Share Posted March 26, 2007 i know basics of php like connecting to server etc but like alogrith etc I dont' know would you be little more specific Link to comment https://forums.phpfreaks.com/topic/44427-php-i-have-no-idea/#findComment-215744 Share on other sites More sharing options...
MadTechie Posted March 26, 2007 Share Posted March 26, 2007 Wait i just read your first post.. surely your just looking for the SQL like INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....) Link to comment https://forums.phpfreaks.com/topic/44427-php-i-have-no-idea/#findComment-215749 Share on other sites More sharing options...
werushka Posted March 26, 2007 Author Share Posted March 26, 2007 INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....) yes that is no problem but when the user visits the index.php how does the php code automatically generates a number between column1 and column2 and posts it to the ındex.php page on a table so after he or she submits it is entered to the x fields in database Link to comment https://forums.phpfreaks.com/topic/44427-php-i-have-no-idea/#findComment-215752 Share on other sites More sharing options...
MadTechie Posted March 26, 2007 Share Posted March 26, 2007 Select column1, column2 from Table then echo rand($A,$B); Link to comment https://forums.phpfreaks.com/topic/44427-php-i-have-no-idea/#findComment-215758 Share on other sites More sharing options...
werushka Posted March 26, 2007 Author Share Posted March 26, 2007 ok i will work into that and will post... Link to comment https://forums.phpfreaks.com/topic/44427-php-i-have-no-idea/#findComment-215759 Share on other sites More sharing options...
DeathStar Posted March 27, 2007 Share Posted March 27, 2007 This will basically reacquire a connection to the two databases and then select the number(int(11)) from the two db fields and do what Madtechie said. Link to comment https://forums.phpfreaks.com/topic/44427-php-i-have-no-idea/#findComment-215765 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.