FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


help: What is wrong with my online form?





syntax101
I CREATED A SIMPLE TUTORIAL FROM DREAMWEAVER 8 USING MYSQL AND PHP IN MY COMPUTER. AND IT WORKS WELL IN MY PC BUT WHEN I UPLOAD MY FILES IN FRIHOST AND TRY IT THERE IS AN ERROR



WHEN I PUSH THE INSERT RECORD THERE IS AN ERROR


also do i have to change this (connection)

Code:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connTownsend = "localhost";
$database_connTownsend = "cafetownsend";
$username_connTownsend = "root";
$password_connTownsend = "";
$connTownsend = mysql_pconnect($hostname_connTownsend, $username_connTownsend, $password_connTownsend) or trigger_error(mysql_error(),E_USER_ERROR);
?>



mathiaus wrote:

Please place code in the code bbcode and do NOT use capitals so much!

ChrisCh
Well the first obvious problem I can see is that your database name needs to be changed (you may even need to make a database in your FriHost account if you have not already done so).

Also, we can't see your images, as you have referenced them to your DirectAdmin area. I have included them below with the correct address:

IMAGE 1:
*removed*

IMAGE 2:

*removed*

Note: edited to removed images that have been moved/removed from server.
syntax101
ok, thank u so any changes here , i already created a database
the name of my database is syntax10_cafetownsend


Code:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connTownsend = "localhost";
$database_connTownsend = "cafetownsend";
$username_connTownsend = "root";
$password_connTownsend = "";
$connTownsend = mysql_pconnect($hostname_connTownsend, $username_connTownsend, $password_connTownsend) or trigger_error(mysql_error(),E_USER_ERROR);
?>





mathiaus wrote:

Added code bbcode tags.

ChrisCh
[quote="syntax101"]ok, thank u so any changes here , i already created a database
the name of my database is syntax10_cafetownsend


Code:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connTownsend = "localhost";
$database_connTownsend = "cafetownsend";
$username_connTownsend = "root";
$password_connTownsend = "rkpax69";
$connTownsend = mysql_pconnect($hostname_connTownsend, $username_connTownsend, $password_connTownsend) or trigger_error(mysql_error(),E_USER_ERROR);
?>

Well the first (and most obvious) thing is to actually put the right database name into the script - simply creating it won't do anything. (ie replace cafetownsend with the actual name (syntax10_cafetownsend) Smile
syntax101
Code:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connTownsend = "localhost";
$database_connTownsend = "syntax10_cafetownsend";
$username_connTownsend = "syntax10_1";
$password_connTownsend = "";

$connTownsend = mysql_pconnect($hostname_connTownsend, $username_connTownsend, $password_connTownsend) or trigger_error(mysql_error(),E_USER_ERROR);
?>


i already created a database in frihost but still dont work so what should i do sir chris.
Diablosblizz
If I remember correctly, your syntax10_1 should have your account name first (unless syntax10 is your account name). If it is your account name already, then maybe your coding is wrong.
kv
I think it should be syntax101, not syntax10. The database name will be

syntax101_cafetownsend

and username will be

syntax101_<whatever username you typed in when creating user>
tidruG
No, your DirectAdmin username is syntax10, not syntax101. This is because we take the first 8 characters of your Forum username as your DirectAdmin username.

So this means that your Databases will be syntax10_<your_db_name>

You should check up the 2 following points:

  1. Have you created the tables in your database? Without the creation of tables, none of the data you try to enter into your database will be entered, of course.
  2. I also see that you have left the password field blank. The user you created probably has a password attached to it. You will need to enter that password, too.
syntax101
i already created a table in my database. and their is a password but i dont have to show it in the forum. so what does the error message means
kv
Can you post the error message you get?
syntax101
kv wrote:
Can you post the error message you get?

This is the error i get

Invalid path: /domains/taconline.frih.net/public_html/cafe_townsend/<, Paths must also begin with a forward slash (/)
syntax101
THIS IS THE CODE IN MY view.php and it does not retrieve any data in my database

Code:
 <?php require_once('Connections/connTownsend.php'); ?>
<?php
$maxRows_rs_Comment = 10;
$pageNum_rs_Comment = 0;
if (isset($_GET['pageNum_rs_Comment'])) {
  $pageNum_rs_Comment = $_GET['pageNum_rs_Comment'];
}
$startRow_rs_Comment = $pageNum_rs_Comment * $maxRows_rs_Comment;

mysql_select_db($database_connTownsend, $connTownsend);
$query_rs_Comment = "SELECT * FROM comments ORDER BY LAST_NAME ASC";
$query_limit_rs_Comment = sprintf("%s LIMIT %d, %d", $query_rs_Comment, $startRow_rs_Comment, $maxRows_rs_Comment);
$rs_Comment = mysql_query($query_limit_rs_Comment, $connTownsend) or die(mysql_error());
$row_rs_Comment = mysql_fetch_assoc($rs_Comment);

if (isset($_GET['totalRows_rs_Comment'])) {
  $totalRows_rs_Comment = $_GET['totalRows_rs_Comment'];
} else {
  $all_rs_Comment = mysql_query($query_rs_Comment);
  $totalRows_rs_Comment = mysql_num_rows($all_rs_Comment);
}
$totalPages_rs_Comment = ceil($totalRows_rs_Comment/$maxRows_rs_Comment)-1;
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
   <title>Cafe Townsend Intranet : Comments</title>
   <link href="assets/cafetownsend.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#000000">
<center>
<table id="main" border="0" cellpadding="0" cellspacing="0" width="700">
    <tbody><tr>
    <td><a href="http://macronet/imd/production/multimedia/cafe_townsend/index.html"><img src="assets/header.jpg" border="0"></a></td>
  </tr>
  <tr>
     <td>&nbsp;</td>
  </tr>
  <tr>
      <td background="assets/body_main_header.gif" class="main">&nbsp;&nbsp;<span class="headertext">Cafe Townsend Intranet</span></td>
  </tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="700">
  <tbody><tr>
    <td width="560" align="center" valign="top" bgcolor="#f7eedf">
     <center>
      <br><table width="600" border="0" cellpadding="4" cellspacing="0" style="border: 1px solid rgb(153, 51, 0);">
      <tr>
       <td bgcolor="#ffffff">
         <p class="italicsbold">Costumer Comments</p>
         <?php echo $row_rs_Comment['FIRST_NAME']; ?>
         <table width="497" border="1" cellspacing="2" cellpadding="2">
              <tr>
                <th width="36" scope="col">First Name </th>
                <th width="47" scope="col">Last Name </th>
                <th width="115" scope="col">E-mail</th>
                <th width="263" scope="col">Comments</th>
              </tr>
              <?php do { ?>
                <tr>
                    <td><?php echo $row_rs_Comment['FIRST_NAME']; ?></td>
                  <td><?php echo $row_rs_Comment['LAST_NAME']; ?></td>
                  <td><?php echo $row_rs_Comment['EMAIL']; ?></td>
                  <td><?php echo $row_rs_Comment['COMMENTS']; ?></td>
                </tr>
                <?php } while ($row_rs_Comment = mysql_fetch_assoc($rs_Comment)); ?>
            </table>         
         <p>&nbsp;</p></td>
      </tr>
      </table>
      <br></center>
    </td>
  </tr>
</tbody></table>
<table border="0" cellpadding="0" cellspacing="0" width="700">
  <tbody><tr>
      <td><img src="assets/body_main_footer.gif" height="25" width="700"></td>
  </tr>
</tbody></table>
</center>
</body>
</html>
<?php
mysql_free_result($rs_Comment);
?>
Related topics
How to create online form submission using phpmyadmin Sql
Help with upload form script! [RESOLVED]
Questions
Help for sign_up form
Need help with submitting form
Help Needed - Online Jackie Stallone Bio
PHP Form Question
AJAX and PHP contact form
Help required with Captcha script
God
neep help making email form that accepts html tags
Cookies?
please please beta test it (PHP coders)
Do we have freedom of expression in our relationships?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.