vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   mySQL & PHP help (https://vborg.vbsupport.ru/showthread.php?t=66600)

Dan 06-27-2004 05:40 PM

mySQL & PHP help
 
This is a non-vB related thing but I thought I'd ask here to see if I could get some help.

I have this form I created which is suppose to insert data into fields in a table in my mysql database but it seems not to work and I have no clue why.

Any help would be appreciated!

going.php
PHP Code:

<?php
include 'header.htm';
?>
<?php
include 'include.php';
?>
  <table width="600" cellpadding="0" cellspacing="0">
  <form name="info" action="./index.php" method="post">
  
    <tr>
    <td valign="top" width="20%">Name:</td><td width="80%"><input type="text" size="50" name="name"  value=""></td>
    </tr>
    
    <tr>
    <td valign="top" width="20%">Are you staying at the hotel?</td><td width="80%"><input type="text" size="50" name="hotel"  value="Yes or No?"></td>
    </tr>
    
    <tr>
    <td valign="top" width="20%">Are you staying Friday?</td><td width="80%"><input type="text" size="50" name="friday"  value="Yes or No?"></td>
    </tr>
    
    <tr>
    <td valign="top" width="20%">Are you staying Saturday?</td><td width="80%"><input type="text" size="50" name="saturday"  value="Yes or No?"></td>
    </tr>
    
    <tr>
    <td valign="top" width="20%">Are you staying Sunday?</td><td width="80%"><input type="text" size="50" name="sunday"  value="Yes or No?"></td>
    </tr>
    
  <tr>
   <td width="100%" align="right" colspan="2"><input type="submit" name="info" value="Submit"></td>
  </tr>
  </form>
  </table>
 

<?php
include 'footer.htm';
?>


include.php
PHP Code:

<?
 mysql_pconnect("localhost","usernameremoved","passwordremoved")
               or die("Unable to connect to SQL server");
 mysql_select_db("infuse_mudmeet") or die("Unable to select database");
if(isset($_POST[info])){
  $F43296slq = mysql_query("INSERT into info values(\"$_POST[name]\", \"$_POST[hotel]\", \"$_POST[friday]\", \"$_POST[saturday]\", \"$_POST[sunday]\" ) ");

    }
?>


and this is what the database looks like

[sql]
CREATE TABLE `info` (
`name` text NOT NULL,
`hotel` text NOT NULL,
`friday` text NOT NULL,
`saturday` text NOT NULL,
`sunday` text NOT NULL
)
[/sql]

assassingod 06-27-2004 05:42 PM

The form action needs to be include.php

Dan 06-27-2004 05:52 PM

Hmm... I never had to do that before..... any clue why?

assassingod 06-27-2004 06:04 PM

Nope, that's just the way I process my forms.


All times are GMT. The time now is 03:39 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01019 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete