Jump to content

Problem with an SQL query sender


xxrealmsxx

Recommended Posts

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
Share on other sites

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
Share on other sites

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

Link to comment
Share on other sites

I'm getting all this from the 3rd Edition of PHP and MYSQL for Dummies  :P

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

Link to comment
Share on other sites

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

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
Share on other sites

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

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

Link to comment
Share on other sites

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
Share on other sites

Probs. However.. don't download files again :P 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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.