Re: [PHP-DB] PHP & MySQL Issue!
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!
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-DB] PHP & MySQL Issue!
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!
- Original Message - From: "Austin C" <[EMAIL PROTECTED]> To: 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: > > > $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) 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! >
[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: 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, '') 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] Individual Array Entries
I am using a mini calendar script which uses the following array to enter event dates. $days = array( 3=>array("/weblog/archive/2004/Jan/03","linked-day"), 8=>array("/weblog/archive/2004/Jan/08","linked-day"), 22=>array("/weblog/archive/2004/Jan/22","linked-day") ); // 3, 8 & 22 = the day // weblog/archive... = the link // linked-day = the CSS class. Because I get the event data from a database and loop through the results of a query, I need to be able to insert each entry individually instead of as a group. The following code fails in that it only lists the last entry: $days = array($theday[$y]=>array("#$thelink[$y]","linked-day")); Using a concatenation fails altogether: $days.= array($theday[$y]=>array("#$thelink[$y]","linked-day")); I just do not know the proper syntax to individually insert entries into this multidimensional array... Please help. Thank you. I tried: $days[$theday] = array("$thelink","linked-day"); But it only displays the last event. Keith -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Individual Array Entries
Hi Everyone, RE: Individual Array Entries I am using a mini calendar script which uses the following array to enter event dates. $days = array( 3=>array("/weblog/archive/2004/Jan/03","linked-day"), 8=>array("/weblog/archive/2004/Jan/08","linked-day"), 22=>array("/weblog/archive/2004/Jan/22","linked-day") ); // 3, 8 & 22 = the day // weblog/archive... = the link // linked-day = the CSS class. Because I get the event data from a database and loop through the results of a query, I need to be able to insert each entry individually instead of as a group. The following code fails in that it only lists the last entry: $days = array($theday[$y]=>array("#$thelink[$y]","linked-day")); Using a concatenation fails altogether: $days.= array($theday[$y]=>array("#$thelink[$y]","linked-day")); I just do not know the proper syntax to individually insert entries into this multidimensional array... Please help. Thank you. Keith -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP/MySQL UTF-8 SNAFU
Hi What functions are you using? Many of PHP's functions are not multibyte aware and default to ASCII. I had this problems myself end of last year. -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP/MySQL UTF-8 SNAFU
Ok, so I have a fully UTF-8 MySQL database with a fully UTF-8 table. I have a php page which has "content="application/xhtml+xml; charset=utf-8" />" at the top of the html section and "mysql_set_charset("utf8");" after my connection (it's php 2.2.3, so that's more or less the same as "mysql_query("SET NAMES 'utf8'");/("SET SESSION character_set_client = "utf8");, though I tried all that too, anyway). I have all my php.ini mbstring stuff configured for utf-8: mbstring.language = Neutral mbstring.internal_encoding = UTF-8 mbstring.http_input = auto mbstring.encoding_translation = On mbstring.detect_order = auto and for what it's worth, echo mb_internal_encoding(); reports "UTF-8". when I run a query that pulls out (in this case, Japanese, but say any) UTF8 data, it displays properly in MySQL Query Browser. With php in the above context however, it does not. Instead, it prints a ? corresponding to each character. When I use mb_detect_encoding(); on each such string, it tells me they are encoded as ASCII. The nearest I can tell is that somewhere between using mysql_query() and mysql_fetch_row(), things got messed up. Is this a bug? Is there something I'm missing? Any clues? Help! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php