View unanswered posts | View active topics It is currently Tue Aug 09, 2022 12:13 pm



Reply to topic  [ 4 posts ] 
 Help me please! 
Author Message
Junior Member

Joined: Sun Mar 09, 2008 7:48 pm
Posts: 4
Post Help me please!
I am a beginner so my question is probably toooo easy for you
please someone help me
I am using dreamweaver to create a new website.
i am trying to host a new website on a shared server.
i created a new database and tables using phpmyadmin.
i connected to the database using dreamweaver and i created a new page called firsttest.php and saved it in public_html/php then i created a new recordset and tried to link it to firsttest.php

when i ran on the hosting server i got this error:

Warning: main(../Connections/test.php) [function.main]: failed to open stream: No such file or directory in /home/som3aa/public_html/php/firsttest.php on line 1

Fatal error: main() [function.require]: Failed opening required '../Connections/test.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/som3aa/public_html/php/firsttest.php on line 1

test is the name of my database
The problem is that it can't locate the database itself, i don't know where is it stored (i just created it with phpmyadmin).
in cpanel i opened php pear.
it says

You will need to add /home/som3aa/php to the include path.
You can do this by adding the following code to your script: ini_set("include_path", '/home/som3aa/php:' . ini_get("include_path") );


all i need to do is type in firsttest.php {Recordset1.Username} for example and i want it to read the name from the database instead it gives me an error that it can't locate the databasePlease guys someone help meThanx in advance guys


Sun Mar 09, 2008 8:13 pm
Report this post
Profile
Junior Member

Joined: Sun Mar 09, 2008 7:48 pm
Posts: 4
Post 
Xnuiem wrote:
The problem here actually isnt MySQL, yet. PHP cant find the file it needs, the test.php.

Why dont you post what you have in firsttest.php and test.php and then where they are in the directories. That may give us the chance to really see what is going on.


Thank you very much xnuiem for ur response.
yes it can't find the file test.php , the problem is that there is no test.php in the first place.
Here is what i did
i created a new page called firsttest.php then in dreamweaver i pressed "+" ==> Mysql connection . then i wrote in connection name :"test" and filled in the rest and in databases i chose my database which is located on the remote server (i don't know where is it stored exactly that's the problem , i can't see any stored files , i created it with phpmyadmin) in dreamweaver i can see the database and the tables , so i chose it(2 files where uploaded to my remote server in /public_html/_mmServerScripts called mysql.php and MMHTTPDB.php

and then created a recordset from the tables inside it , so this code was generated in firsttest.php

Code:
<?php require_once('../Connections/test.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;   
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
mysql_select_db($database_test, $test);
$query_Recordset1 = "SELECT * FROM login";
$Recordset1 = mysql_query($query_Recordset1, $test) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/URL]">
<html xmlns="[url=http://www.w3.org/1999/xhtml]XHTML namespace[/URL]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>


i think the problem is here
Code:
<?php require_once('../Connections/test.php'); ?>

this folder is emtpy and i don't know where is test.php , i don't even know if there is a file which is called test.php , test is just the name of the connection.

Hope you can help me
Thank you very much m8


Mon Mar 10, 2008 8:40 am
Report this post
Profile
Junior Member

Joined: Sun Mar 09, 2008 7:48 pm
Posts: 4
Post 
Continue:
sorry i can't edit my post so i will continue here

check this site:

Factsheet 19: How can I link my web pages to a database? PHP and MySQL

This is exactly what i did,the only difference is that im using dreamweaver cs3

Quote:
Dreamweaver MX will then automatically insert the PHP code for this query into your web page.


This is the problem , it creates the code but the code tries to connect to a wrong location.
i did all the previous steps and i can browse the tables i created and everything

Hope you can help me
Thank you


Mon Mar 10, 2008 9:05 am
Report this post
Profile
Junior Member

Joined: Sun Mar 09, 2008 7:48 pm
Posts: 4
Post 
omgggggggggggggggggggggggggggggggggggggg

PROBLEM SOLVED!!!!!!!!!!!!!!!!!!!

u know man i spent like more than 7-8 hours on this problem alone!!!!!!!!!!!!!!


u know whose fault was it??????????????

it turned out to be dreamweavers fault since it didn't upload the file test.php automatically to my server!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


i can't believe that the problem is solved!!!!!!!!!!!!!!

Thank you veryyyyyyyyyyyyyyyyyyyyyy much man for ur response , i looked everywhere on the server for this file but i couldn't find it and at the end it was on my computer lol :D


Mon Mar 10, 2008 9:21 am
Report this post
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.