logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Video Tutorials
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 06-04-2008, 11:26 PM   #1
heirani1
 
Join Date: Dec 2007
Posts: 10
Question Putting database files onto server

well i have been working through the tutorials online about php, the one where you use wamp and a database and connect them etc.

Well my question is i have done the tutorial but if i wanted to put the files onto a server how would i get the database onto the server if you know what i mean?

Thanks fot your help,

Chris
heirani1 is offline   Reply With Quote
Old 06-05-2008, 05:37 AM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

you would export your database and then import it into your new db

not sure if you have an export function available from EMS. Most IDE's do have this feature. You need to create the db on your live machine and then in the console (HELM or whatever) should have an import option
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 06-05-2008, 01:29 PM   #3
heirani1
 
Join Date: Dec 2007
Posts: 10
Default

EMS has to export functions, one is a export data wizard the other is a export as SQL Script, do you know which one i would need to put it onto a host?
heirani1 is offline   Reply With Quote
Old 06-05-2008, 01:52 PM   #4
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

Quote:
Originally Posted by heirani1 View Post
EMS has to export functions, one is a export data wizard the other is a export as SQL Script, do you know which one i would need to put it onto a host?
I've used both, but you have to ask your host what will work.
domedia is offline   Reply With Quote
Old 06-05-2008, 02:53 PM   #5
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

a SQL script is a text file which carries the correct syntax for import

it will include DROP, UPDATE and INSERT's as per standard SQL

you can save this off and it should import into your LIVE machine
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 06-05-2008, 08:29 PM   #6
heirani1
 
Join Date: Dec 2007
Posts: 10
Thumbs up

ok thanks for clearing that up for me, apprecaite your help
heirani1 is offline   Reply With Quote
Old 06-08-2008, 11:48 AM   #7
heirani1
 
Join Date: Dec 2007
Posts: 10
Default error message...

i just got round to testing this on ther live computer, when i run login.php i can enter the username and password but then it comes up with this ...

Warning: Cannot modify header information - headers already sent by (output started at /www/99k.org/c/h/r/chrisheirani/htdocs/connection/connection.php:11) in /www/99k.org/c/h/r/chrisheirani/htdocs/login.php on line 21

what does this error message mean? and how can i fix it?

the login.php code is here ...

Code:
<?php
require_once("connection/connection.php"); //database connection
// catch field data
$userid  = $_POST['userid'];
$password = $_POST['password'];
$submitted = $_POST['submitted'];
// if data is entered into these 2 fields then process code in {}
if ($userid && $password) {
///////////////////////////////////////////////////////////////
$query  = sprintf("SELECT * FROM users where user_name='$userid' and                     user_password='$password'");
$result  = @mysql_query ($query);
$rowAccount = @mysql_fetch_array($result);
///////////////////////////////////////////////////////////////
}
if ($rowAccount) {
$_SESSION ['id'] = $rowAccount['user_id'];
header("location:welcome.php");
exit;
}elseif ($submitted) {
echo "you dont exist in the system you cannot enter";
}
?>
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
  <table width="270" height="111" border="1" align="center">
    <tr>
      <td width="86">User ID</td>
      <td width="168"><label>
        <input type="text" name="userid" id="userid" />
      </label></td>
    </tr>
    <tr>
      <td>Password</td>
      <td><label>
        <input type="text" name="password" id="password" />
      </label></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><label>
         <input name="submitted" type="hidden" id="submitted" value="1" />
         <input type="submit" name="Submit" id="button" value="Submit" />
      </label></td>
    </tr>
  </table>
</form>
</body>
</html>
heirani1 is offline   Reply With Quote
Old 06-08-2008, 04:22 PM   #8
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

you have an echo which is outputting data befor the headers are sent

you need to asign all messages in a variable which you echo in your html
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 06-08-2008, 10:40 PM   #9
heirani1
 
Join Date: Dec 2007
Posts: 10
Default

so how would i do that?
I followed the VT that you done, unless i made a mistake somewhere, thanks again for your help
heirani1 is offline   Reply With Quote
Old 06-08-2008, 10:56 PM   #10
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

whereyou have this...

PHP Code:
echo "you dont exist in the system you cannot enter"
needs to be

PHP Code:
$message "you dont exist in the system you cannot enter"
then echo $message in the html where you want the message to appear
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:18 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com