xxrealmsxx Posted April 17, 2010 Share Posted April 17, 2010 I am receiving this error: Database Selected: Query:CREATE DATABASE test Results Fatal error: Call to undefined function myqsli_error() in C:\xampp\htdocs\mysql_send.php on line 26 For the attached file. Anyone care to give me a hand? I am very new to this. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/ Share on other sites More sharing options...
TeddyKiller Posted April 17, 2010 Share Posted April 17, 2010 mysqli is spelt wrong. Line 26, change myqsli_error, to mysqli_error Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043904 Share on other sites More sharing options...
xxrealmsxx Posted April 17, 2010 Author Share Posted April 17, 2010 mysqli is spelt wrong. Line 26, change myqsli_error, to mysqli_error haha so you mean all this time I wasted looking at php.ini was a spelling error? Thanks! Side question, do you have any idea why when I run SHOW DATABASES my query doesn't show any databases, but then when I run CREATE DATABASE test I get the following: Error: Can't create database 'test'; database exists? Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043915 Share on other sites More sharing options...
TeddyKiller Posted April 17, 2010 Share Posted April 17, 2010 For the second bit.. you must already have a database called test. I'm not sure what your trying to achieve with SHOW DATABASES. I've never actually seen it like that. Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043918 Share on other sites More sharing options...
TeddyKiller Posted April 17, 2010 Share Posted April 17, 2010 $rows = mysql_query("show databases"); while ($row = mysql_fetch_assoc($rows)) { print $row['Database']; } Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043919 Share on other sites More sharing options...
xxrealmsxx Posted April 17, 2010 Author Share Posted April 17, 2010 For the second bit.. you must already have a database called test. I'm not sure what your trying to achieve with SHOW DATABASES. I've never actually seen it like that. Yeah I figured as much, thanks! $rows = mysql_query("show databases"); while ($row = mysql_fetch_assoc($rows)) { print $row['Database']; } I'm getting all this from the 3rd Edition of PHP and MYSQL for Dummies Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043920 Share on other sites More sharing options...
TeddyKiller Posted April 17, 2010 Share Posted April 17, 2010 I'm getting all this from the 3rd Edition of PHP and MYSQL for Dummies Good stuff. You could benefit from O'Reillys PHP Programming 2nd Edition. I like it It's got some stuff I never knew, and it was only in the chapter of basics.. Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043922 Share on other sites More sharing options...
xxrealmsxx Posted April 17, 2010 Author Share Posted April 17, 2010 I'm getting all this from the 3rd Edition of PHP and MYSQL for Dummies Good stuff. You could benefit from O'Reillys PHP Programming 2nd Edition. I like it It's got some stuff I never knew, and it was only in the chapter of basics.. Cool thanks for the tip! A friend of mine and I are going through this book just to get our feet wet and then will move onto more "non dummy" materials Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043923 Share on other sites More sharing options...
xxrealmsxx Posted April 17, 2010 Author Share Posted April 17, 2010 Another quick question, how do I show a list of the databases I have if the command isn't SHOW DATABASES ? Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043926 Share on other sites More sharing options...
TeddyKiller Posted April 17, 2010 Share Posted April 17, 2010 Cool thanks for the tip! A friend of mine and I are going through this book just to get our feet wet and then will move onto more "non dummy" materials I guess you could always try reading the whole of PHP.net .. that'll keep you entertained for a while. It's free too! xD - I don't think you can... that's a job for a bigger nerd. I'm still amatuer Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043927 Share on other sites More sharing options...
xxrealmsxx Posted April 17, 2010 Author Share Posted April 17, 2010 Cool thanks for the tip! A friend of mine and I are going through this book just to get our feet wet and then will move onto more "non dummy" materials I guess you could always try reading the whole of PHP.net .. that'll keep you entertained for a while. It's free too! xD - I don't think you can... that's a job for a bigger nerd. I'm still amatuer Gotcha, Well I tried the command in phpMyAdmin and it does output all of the databases. I think this mysql_send.php file the book had me create is just dumb Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043930 Share on other sites More sharing options...
TeddyKiller Posted April 17, 2010 Share Posted April 17, 2010 What does the book say? Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043931 Share on other sites More sharing options...
xxrealmsxx Posted April 17, 2010 Author Share Posted April 17, 2010 What does the book say? Well I thought I re-typed it all correctly, but I downloaded this file: http://www.janetvalade.com/Programs/phpfd3/ch04/mysql_send.phps Updated the username and now SHOW DATABASES gives me this output: Database Selected: Query: SHOW DATABASES Results Database information_schema cdcol memberdirectory mysql petcatalog phpmyadmin test So I guess I mis-typed something. Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043936 Share on other sites More sharing options...
TeddyKiller Posted April 17, 2010 Share Posted April 17, 2010 Probs. However.. don't download files again it doesn't help. I guess you can always retype it based on it. Typing is better than copying and pasting, as it gives memory to your fingers, and your reading as you go along. Thus making it stick in your head Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043937 Share on other sites More sharing options...
xxrealmsxx Posted April 18, 2010 Author Share Posted April 18, 2010 Probs. However.. don't download files again it doesn't help. I guess you can always retype it based on it. Typing is better than copying and pasting, as it gives memory to your fingers, and your reading as you go along. Thus making it stick in your head Yeah I plan on re-doing it, thanks! Link to comment https://forums.phpfreaks.com/topic/198874-problem-with-an-sql-query-sender/#findComment-1043986 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.