PHP & MySQL Issue!

PHP & MySQL Issue!

am 13.07.2007 03:41:48 von Austin C

------=_Part_28487_7696839.1184290908863
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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:


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

echo "


Install- Processing Database Info . . . . .


";

$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, ' $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!

------=_Part_28487_7696839.1184290908863--

Re: PHP & MySQL Issue!

am 13.07.2007 04:33:07 von bedul

------=_NextPart_000_005B_01C7C530.D1BC9E50
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: base64

DQotLS0tLS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Cj4gDQo=

------=_NextPart_000_005B_01C7C530.D1BC9E50--

Re: PHP & MySQL Issue!

am 13.07.2007 04:47:54 von 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 & MySQL Issue!

am 13.07.2007 04:50:23 von Austin C

------=_Part_28799_7762183.1184295023011
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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 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

------=_Part_28799_7762183.1184295023011--

Re: PHP & MySQL Issue!

am 13.07.2007 04:51:49 von dmagick

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

Re: PHP & MySQL Issue!

am 13.07.2007 16:25:11 von Dwight Altman

--Apple-Mail-4--128918742
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed


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



--Apple-Mail-4--128918742--

Re: PHP & MySQL Issue!

am 13.07.2007 17:51:59 von Dwight Altman

--Apple-Mail-5--123710338
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed


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



--Apple-Mail-5--123710338--