4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: Jaap12 on August 27, 2002, 03:09:24 PM
-
Hi i have made this code for a modification :
<?
$dbase_connect = mysql_connect("localhost", "user", "pass");
mysql_select_db($dbnamehere, $dbase_connect); // ;
$sql = "SELECT * FROM 4images_images WHERE image_winkel BETWEEN 10 AND 40";
$resultaat = mysql_query($sql);
if ($result)
{
while ($image_winkel = mysql_fetch_object ($resultaat)) {
echo "<b>$image_winkel->winkel</b>\n";
}
}
else
{
echo "query mislukt".mysql_error();
}
?>
but i get this error:
query misluktNo Database Selected
but all the details are right
did i have seen something wrong?
Greetz,
Bas
-
if ($result)
{
must be
if ($resultaat)
{
Greets Jan
-
makes no different same error :(
i have as table:
SELECT * FROM 4images_images WHERE image_test BETWEEN 10 AND 40
don't must be something like this?
SELECT * FROM i.4images_images WHERE i.image_test BETWEEN 10 AND 40
-
Are you sure that $dbnamehere is filled with the right database name?
Jan
-
yep , i use the same details as 4images photo gallery
-
Can you post the whole script.
Jan
-
This is the hole script.
This is only a command to read the data out the database and select the different prices. And let them display on a page. But it doesn't work.
I think this is the right solution. But i don't know the database structure from your application.
-
You don't set $dbnamehere.
Use
$dbnamehere = "Database_Name";
or
mysql_select_db("Database_Name", $dbase_connect);
Greets Jan
-
sorry ,
but that's not the problem, i had set that to display the functions.
I know there must be my database name.
This was only for a example.
How do you use the "between"function?
Do you have a other way to show the data?
-
You have posted this error message:
No Database Selected
This means that have not selected a database correctly.
Jan
-
mysql_select_db("YOURDBHERE", $dbase_connect);
is correct in your example for database connect, like Jan posted it allready