I made a database on mysql through xampp, phpmy admin. I gave it the name 'game'. Since mysql gives you the code name your supposed to use in your php code, i want to know how to get that paticular name. Eg- thenewbp-bucky
Four answers:
?
2013-01-05 08:27:40 UTC
The name you gave it is the same what you'd use in your code.
Rick J
2013-01-05 11:41:47 UTC
First, let's be clear about "database" versus "table".
A "database" is similar to a folder (directory). You create it with a CREATE DATABASE statement (which phpmyadmin is probably doing for you behind the scenes). You can list the databases in the server via the SHOW DATABASES statement (or find the way the UI does such for you). To start with, a server will have `mysql`, `test`, and `information_schema`. It is ok to play with `test`, but not the other two.
A "table" (like a file) contains data. A table lives in one database. It is created via CREATE TABLE (or the UI equivalent). You will INSERT data into a table; then you will fetch it via a SELECT (or the UI equivalents).
broers
2016-12-15 00:40:45 UTC
whilst the database isn't looking the '$call' fee on your container it is returning 0 rows. I wager your Hypertext Preprocessor code assumes which you're turning out to be to be a minimum of one row back. subsequently the errors whilst the source does not have something in it. There are 2 techniques around it. the two you could regulate your sq. to $question = "choose count variety(*) FROM shoppers the place call='$call';"; which will assure you a effect the place you could merely verify that it particularly is greater beneficial than 0 or you ought to use the mysql_num_rows() function to earnings which you particularly have a row in the past you fetch the 1st row e.g. // does consumer exist? $call = mysql_real_escape_string($call); $question = "choose * FROM shoppers the place call='$call';"; $res = mysql_query($question); if (mysql_num_rows($res) > 0) { // sure, pull interior the consumer information } else // no, consumer does not exist }
?
2013-01-05 07:28:18 UTC
Mysql wont give the name.
Databases are named manually.
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.