Click here to Skip to main content
16,004,854 members
Home / Discussions / Database
   

Database

 
AnswerRe: Procedure or function has too many arguments specified Pin
S Pandian11-Aug-06 19:07
S Pandian11-Aug-06 19:07 
GeneralRe: Procedure or function has too many arguments specified Pin
R. A. Abbasi11-Aug-06 23:56
R. A. Abbasi11-Aug-06 23:56 
Questionerror when start computer from sqlmanger.exe Pin
hi_arv11-Aug-06 1:08
hi_arv11-Aug-06 1:08 
AnswerRe: error when start computer from sqlmanger.exe Pin
Colin Angus Mackay11-Aug-06 2:26
Colin Angus Mackay11-Aug-06 2:26 
QuestionTSQL - How to retrieve a random record? Pin
matthias s.10-Aug-06 21:37
matthias s.10-Aug-06 21:37 
AnswerRe: TSQL - How to retrieve a random record? Pin
Colin Angus Mackay10-Aug-06 22:04
Colin Angus Mackay10-Aug-06 22:04 
GeneralRe: TSQL - How to retrieve a random record? Pin
Frank Kerrigan11-Aug-06 5:18
Frank Kerrigan11-Aug-06 5:18 
QuestionCreating a table in mysql using a php form? Pin
RottNKorpse10-Aug-06 9:35
RottNKorpse10-Aug-06 9:35 
Well I am trying to make an admin section to allow my other admins of my site able to add content to my mysql database without giving them phpmyadmin access and without teaching them out to use it as well. So I am trying to make a form that they can use to fill in a few simple fields and then it create the tables in the database and then insert a row in a seperate table that is already made.

Here is how I want it to work...
Name:
Filename:
Category:
Header Image:

"Name" would be used for the print output saying that "NameHere has been added to the database" and also be used in inserting a value in a table that has already been created called "pageheaders".

The Filename will be used many times...this will be the from portion of the names of the tables as well as part of the insert into pageheaders.

Category will just be part of the insert into pageheaders.
Header Image is also just part of the insert.

Here is the form portion of what I am trying to do...the action is calling to another page where the sql stuff is because that is the only way I knew to do it but if you know a better way to have them in the same file then I am more than happy to use that.

Form Code:
<form action="tablesandinsert.php" method="post"><br />
Name: <input type="text" name="name"><br><br />
Filename: <input type="text" name="filename"><br><br />
Category: <input type="text" name="category"><br><br />
Header Image: <input type="text" name="headerimage"><br><br />
<input type="submit" value="Submit"><br />
</form>


And here is the sql code that is used for inserting and creating sql stuff...it doesnt actually insert anything or create the tables so I obviously did something wrong.

SQL Stuff:
$name=$_POST['name'];<br />
$filename=$_POST['filename'];<br />
$category=$_POST['category'];<br />
$headerimage=$_POST['headerimage'];<br />
<br />
$query="CREATE TABLE `$filename_fins` (<br />
  `gif_id` mediumint(9) NOT NULL auto_increment,<br />
  `fingifurl` text NOT NULL,<br />
  PRIMARY KEY  (`gif_id`)<br />
) ENGINE=MyISAM DEFAULT CHARSET=latin1;<br />
<br />
CREATE TABLE `$filename_trons` (<br />
  `gif_id` mediumint(9) NOT NULL auto_increment,<br />
  `trongifurl` text NOT NULL,<br />
  PRIMARY KEY  (`gif_id`)<br />
) ENGINE=MyISAM DEFAULT CHARSET=latin1;<br />
<br />
CREATE TABLE `$filename_misc` (<br />
  `gif_id` mediumint(9) NOT NULL auto_increment,<br />
  `miscgifurl` text NOT NULL,<br />
  PRIMARY KEY  (`gif_id`)<br />
) ENGINE=MyISAM DEFAULT CHARSET=latin1;<br />
<br />
INSERT INTO `pageheaders` VALUES ('$name', '$filename', '$headerimage', '$category/$filename/index');";<br />
$result=mysql_query($query);<br />
Print "$name has been successfully added to the database.";<br />
?>


so any help on where I went wrong?
Questionoracle Pin
fmardani10-Aug-06 4:46
fmardani10-Aug-06 4:46 
AnswerRe: oracle Pin
Chris Meech11-Aug-06 6:45
Chris Meech11-Aug-06 6:45 
AnswerRe: oracle Pin
mrsnipey14-Aug-06 22:23
mrsnipey14-Aug-06 22:23 
QuestionDate is changing from a one day. Pin
pubududilena10-Aug-06 4:31
pubududilena10-Aug-06 4:31 
AnswerRe: Date is changing from a one day. Pin
zhengdong jin10-Aug-06 7:27
zhengdong jin10-Aug-06 7:27 
Questionerror through connection Pin
md_refay10-Aug-06 3:33
md_refay10-Aug-06 3:33 
AnswerRe: error through connection Pin
Colin Angus Mackay10-Aug-06 4:18
Colin Angus Mackay10-Aug-06 4:18 
Questionhow to get a specific row Pin
sudharsong10-Aug-06 2:15
sudharsong10-Aug-06 2:15 
AnswerRe: how to get a specific row Pin
Eric Dahlvang10-Aug-06 2:54
Eric Dahlvang10-Aug-06 2:54 
AnswerRe: how to get a specific row Pin
fs6310-Aug-06 20:23
fs6310-Aug-06 20:23 
AnswerRe: how to get a specific row Pin
S Pandian11-Aug-06 19:21
S Pandian11-Aug-06 19:21 
QuestionForeignKeyConstrait Pin
pirogramci10-Aug-06 2:12
pirogramci10-Aug-06 2:12 
AnswerRe: ForeignKeyConstrait Pin
OldWarhorse11-Oct-06 0:40
OldWarhorse11-Oct-06 0:40 
QuestionLosing "random" characters from strings when updating tables Pin
Ed.Poore10-Aug-06 2:00
Ed.Poore10-Aug-06 2:00 
AnswerRe: Losing "random" characters from strings when updating tables Pin
Steve S10-Aug-06 3:54
Steve S10-Aug-06 3:54 
GeneralRe: Losing "random" characters from strings when updating tables Pin
Ed.Poore10-Aug-06 9:50
Ed.Poore10-Aug-06 9:50 
QuestionTripleDESCryptoServiceProvider - TripleDES encryption Pin
lehya10-Aug-06 0:52
lehya10-Aug-06 0:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.