The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
Hi people, can anyone tell me how I would connect to my DB, to a table called domains, and add data to it, then disconnect, the database is also called domains, and the user is root.
|
|
#2
|
||||
|
||||
|
Roughly:
PHP Code:
|
|
#3
|
||||
|
||||
|
cheers,
|
|
#4
|
||||
|
||||
|
come to try it, but i failed
, here is my code:PHP Code:
Code:
<form action="db.php" method="post" enctype="multipart/form-data" name="domains" target="_self" class="bodytext" id="domains">
<table width="525" border="0">
<tr>
<td>First Name:</td>
<td><input type="text" name="fname" /></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input type="text" name="lname" /></td>
</tr>
<tr>
<td>Email Address:</td>
<td><input type="text" name="email" /></td>
</tr>
<tr>
<td>Domain Name:</td>
<td><input type="text" name="domain" /></td>
</tr>
<tr>
<td><p>Registration Years:</p>
</td>
<td><input type="text" name="length" /></td>
</tr>
<tr>
<td valign="top">Mailing Address:</td>
<td><textarea name="address" cols="40" rows="5"></textarea></td>
</tr>
</table>
<p>* - All Fields Required</p>
<p>
<input type="submit" name="Submit" value="Submit" />
<input type="reset" name="Reset" value="Reset" />
</p>
</form>
|
|
#5
|
||||
|
||||
|
PHP Code:
|
|
#6
|
||||
|
||||
|
YAY, data got inserted into the DB, it was all 0 though, can anyone please tell me what type of field i want because I am using TINYINTs at the min and it doesnt work. Cheers Chen.
|
|
#7
|
||||
|
||||
|
You need to use VARCHAR (or CHAR) for string types, and TINYINT / SMALLINT / INT for integers.
|
|
#8
|
||||
|
||||
|
ok, getting there and thanx for the help, now, as before i could see 0's, not MySQL Front says the data is there, but I cant view it.
|
|
#9
|
||||
|
||||
|
You will need to enter the data again.
|
|
#10
|
||||
|
||||
|
hehe
, is there anyway I can make the page display a redirection note like vB and then take them back to my homepage? Thanks for the intense help!
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|