Re: [PHP-DB] PHP MySQL Issue!

2007-07-13 Thread Dwight Altman


On Jul 12, 2007, at 9:50 PM, Austin C wrote:

Hello, I dont get any errors. Just a blank page. But, I go to the  
database,

and it did what I told it to with the header table, but not with the
circulation table.


Check your error log or add this as the first line in your script.
ini_set('display_errors', '1');

Maybe you are testing this on a production server with errors not  
displayed.


Remove the line before you deploy the code.

Hopefully you will see a meaningful message now.

Regards,
Dwight




Re: [PHP-DB] PHP MySQL Issue!

2007-07-13 Thread Dwight Altman


On Jul 12, 2007, at 9:50 PM, Austin C wrote:

Hello, I dont get any errors. Just a blank page. But, I go to the  
database,

and it did what I told it to with the header table, but not with the
circulation table.


After you built the SQL for the circulation table, you did not  
execute it [with a $query = mysqli_query($cxn,$sql);].  Instead, you  
selected the db again.  Your code did what you told it to do.  Hence,  
no error messages.



Regards,
Dwight




[PHP-DB] PHP MySQL Issue!

2007-07-12 Thread Austin C

Hello everyone, im trying to use PHP to create 2 tables in a database and
populate them with tables, however, it just wont work. Here is my full code:


?php
$hostname = $_GET['hostname'];
$dbname = $_GET['dbname'];
$dbusername = $_GET['dbusername'];
$dbpassword = $_GET['dbpassword'];
$dbprefix = $_GET['dbprefix'];

echo centerbrbInstall- Processing Database Info . . . . ./b
p
p;

$cxn = mysqli_connect($hostname,$dbusername,$dbpassword,$dbname)
  or die (Basic Library System could not connect to the database you
specified. Please go back and make sure the information you submitted is
correct.);

$file = '../config.php';

$fh = fopen($file, 'w') or die('Failed to open config.php file');

fwrite($fh, '?php $hostname='.$hostname.';
$dbname='.$dbname.';
$dbusername='.$dbusername.';
$dbpassword='.$dbpassword.';
$dbprefix='.$dbprefix.'; ?') or die('Could not write to config.php');

fclose($fh);

mysqli_select_db($cxn,$dbname)
 or die (Could not connect to the database you specified. Please go
back and make sure you entered the correct database.);

mysqli_select_db($cxn,$dbname);
$sql = CREATE TABLE .$dbprefix._circulation
(
title varchar(100),
author varchar(100),
pubdate varchar(100),
genre varchar(100),
medium varchar(100),
price varchar(100),
id int(20) NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id)
);

mysqli_select_db($cxn,$dbname);
$sql = CREATE TABLE .$dbprefix._holder
(
space varchar(100)
);

$query = mysqli_query($cxn,$sql);
if(!$query){
echo Basic Library System was unable to submit the information to the
database. Please make sure you specified correct information.;
}else{
echo Successfully created table. Do something here;
}

mysqli_close($cxn);
?



--

Visit galacticwebdesigns.com for tutorials and more!


Re: [PHP-DB] PHP MySQL Issue!

2007-07-12 Thread Austin C

Hello, I dont get any errors. Just a blank page. But, I go to the database,
and it did what I told it to with the header table, but not with the
circulation table.

On 7/12/07, Niel [EMAIL PROTECTED] wrote:


Hi

Give us a clue? What's the error(s) you get returned?
--
Niel Archer

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
Thanks, the webmaster of Galacticneo


Re: [PHP-DB] PHP MySQL Issue!

2007-07-12 Thread bedul

- Original Message - 
From: Austin C [EMAIL PROTECTED]
To: php-db@lists.php.net
Sent: Friday, July 13, 2007 8:41 AM
Subject: [PHP-DB] PHP  MySQL Issue!


 Hello everyone, im trying to use PHP to create 2 tables in a database and
 populate them with tables, however, it just wont work. Here is my full code:
 
 
 ?php
 $hostname = $_GET['hostname'];
 $dbname = $_GET['dbname'];
 $dbusername = $_GET['dbusername'];
 $dbpassword = $_GET['dbpassword'];
 $dbprefix = $_GET['dbprefix'];
 
 echo centerbrbInstall- Processing Database Info . . . . ./b
 p
 p;
 
 $cxn = mysqli_connect($hostname,$dbusername,$dbpassword,$dbname)
or die (Basic Library System could not connect to the database you
 specified. Please go back and make sure the information you submitted is
 correct.);
 
 $file = '../config.php';
 
 $fh = fopen($file, 'w') or die('Failed to open config.php file');
 
 fwrite($fh, '?php $hostname='.$hostname.';
 $dbname='.$dbname.';
 $dbusername='.$dbusername.';
 $dbpassword='.$dbpassword.';
 $dbprefix='.$dbprefix.'; ?') or die('Could not write to config.php');
 
 fclose($fh);
 
 mysqli_select_db($cxn,$dbname)

are this should be
mysqli_select_db($dbname, $cxn) ???
and the rest seem miss place in the function


   or die (Could not connect to the database you specified. Please go
 back and make sure you entered the correct database.);
 
 mysqli_select_db($cxn,$dbname);
 $sql = CREATE TABLE .$dbprefix._circulation
 (
 title varchar(100),
 author varchar(100),
 pubdate varchar(100),
 genre varchar(100),
 medium varchar(100),
 price varchar(100),
 id int(20) NOT NULL AUTO_INCREMENT,
 PRIMARY KEY(id)
 );
 
 mysqli_select_db($cxn,$dbname);
 $sql = CREATE TABLE .$dbprefix._holder
 (
 space varchar(100)
 );
 
 $query = mysqli_query($cxn,$sql);
 if(!$query){
 echo Basic Library System was unable to submit the information to the
 database. Please make sure you specified correct information.;
 }else{
 echo Successfully created table. Do something here;
 }
 
 mysqli_close($cxn);
 ?
 
 
 
 --
 
 Visit galacticwebdesigns.com for tutorials and more!
 


Re: [PHP-DB] PHP MySQL Issue!

2007-07-12 Thread Niel
Hi

Give us a clue? What's the error(s) you get returned?
--
Niel Archer

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PHP MySQL Issue!

2007-07-12 Thread Chris

Austin C wrote:

Hello everyone, im trying to use PHP to create 2 tables in a database and
populate them with tables, however, it just wont work. 


Where does it stop working? Looks fine from what you've shown us but you 
need to track down the problem a bit further.


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php