| | |
problem with php mysql query....sos
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2009
Posts: 5
Reputation:
Solved Threads: 0
php Syntax (Toggle Plain Text)
<?php if ($_SERVER['REQUEST_METHOD'] == 'POST'){ $getLima=$_POST['Onoma']; include "connect.php"; $rsSelectOnomata=mysql_query("SELECT * FROM titloslimmatos WHERE LimmatikosTypos='$getLima'"); //$result=mysql_query($query); while($rsRow=mysql_fetch_assoc($rsSelectOnomata)) { echo $rsRow[titloslimmatos.LimmatikosTypos]; $rsRow[titloslimmatos.MerosLogoy]; $rsRow[titloslimmatos.YfologikoEpipedo]; $rsRow[titloslimmatos.GlwssikoEpipedo]; //$rsRow[extralimmatikoitypoi.ExtraLimmatikosTypos]; //$rsRow[extralimmatikoitypoi.YfologikoEpipedo]; //$rsRow[Simasia.XrisiLeksis]; //$rsRow[synonimo.Synonimo]; //$rsRow[synonimo.Example]; //$rsRow[antitheto.Antitheto]; //$rsRow[antitheto.Example]; } } else { ?> <html> <body bgcolor="#FFFFCC"> <h3><center><b>Δώστε το λήμμα που ψάχνετε</b></center></h3> <table> <form method="post" action="<? echo $PHP_SELF ?>"> <input name="onoma" type="text"> <input type="Submit" name="set" > </form> </table> </body> </html> <? } ?>
Last edited by Ezzaral; May 20th, 2009 at 10:44 pm. Reason: Added [code] [/code] tags. Please use them to format any code that you post.
Might help to state what the problem is. I don't want to sit here looking through your code without knowing what I am looking for.
Also, use code tags.
Also, use code tags.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
•
•
Join Date: May 2009
Posts: 5
Reputation:
Solved Threads: 0
i want to make a site on line dictionary, i use the programm xampp,
when i run this code (localhost) and insert a word that exist in my database the result is a blank page...
can someone help me? its emergency!
also sometimes when i run this code it's show me:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\index.php on line 12
when i run this code (localhost) and insert a word that exist in my database the result is a blank page...
can someone help me? its emergency!
also sometimes when i run this code it's show me:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\index.php on line 12
Last edited by anna05; May 21st, 2009 at 1:06 pm.
Print and execute the query in phpmyadmin / mysql console. Check the error message.
OR
Use
This will print the error message on failure. This is good for testing purpose (and not in the production environment as it exposes your table structure and all that!)
OR
Use
php Syntax (Toggle Plain Text)
$rsSelectOnomata=mysql_query("SELECT * FROM titloslimmatos WHERE LimmatikosTypos='$getLima'") or die(mysql_error());
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
What nav33n said.
Also, if you want to search for values which I guess you will do for a dictionary, look into the LIKE operator for your SQL query.
Also, if you want to search for values which I guess you will do for a dictionary, look into the LIKE operator for your SQL query.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
•
•
Join Date: May 2009
Posts: 5
Reputation:
Solved Threads: 0
index.php
-------------------------------------------------------------
connect.php
when i run the file index.php the result was:
Connected successfully No database selected
any idea please?
php Syntax (Toggle Plain Text)
<?php if ($_SERVER['REQUEST_METHOD'] == 'POST'){ $getLima=$_POST['Onoma']; include "connect.php"; $rsSelectOnomata=mysql_query("SELECT * FROM titloslimmatos WHERE LimmatikosTypos='$getLima'") or die(mysql_error()); $result1=mysql_query($query); while($rsRow=mysql_fetch_assoc($rsSelectOnomata)) { echo $rsRow[titloslimmatos.LimmatikosTypos]; $rsRow[titloslimmatos.MerosLogoy]; $rsRow[titloslimmatos.YfologikoEpipedo]; $rsRow[titloslimmatos.GlwssikoEpipedo]; //$rsRow[extralimmatikoitypoi.ExtraLimmatikosTypos]; //$rsRow[extralimmatikoitypoi.YfologikoEpipedo]; //$rsRow[Simasia.XrisiLeksis]; //$rsRow[synonimo.Synonimo]; //$rsRow[synonimo.Example]; //$rsRow[antitheto.Antitheto]; //$rsRow[antitheto.Example]; } } else { ?> <html> <body bgcolor="#FFFFCC"> <h3><center><b>Δώστε το λήμμα που ψάχνετε</b></center></h3> <table> <form method="post" action="<? echo $PHP_SELF ?>"> <input name="onoma" type="text"> <input type="Submit" name="set" > </form> </table> </body> </html> <? } ?>
-------------------------------------------------------------
connect.php
php Syntax (Toggle Plain Text)
<?php $link = mysql_connect('localhost', 'root', ''); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); ?>
when i run the file index.php the result was:
Connected successfully No database selected
any idea please?
Last edited by Ezzaral; May 21st, 2009 at 4:02 pm. Reason: Added [code] [/code] tags. Please use them to format any code that you post.
Why oh why did I even bother writing the FAQ that answers this very issue if no one is going to read it? It never stops baffling me when I see these posts.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
•
•
Join Date: May 2009
Posts: 5
Reputation:
Solved Threads: 0
sorry.. that was by mistake...
the code of connect.php is:
i run again the file index.php and the result was:
Connected successfully
whay it doesn't show me the word that i insert?
the code of connect.php is:
php Syntax (Toggle Plain Text)
<?php $link = mysql_connect('localhost', 'root', ''); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_select_db("annadb"); //mysql_close($link); ?>
i run again the file index.php and the result was:
Connected successfully
whay it doesn't show me the word that i insert?
Last edited by Ezzaral; May 21st, 2009 at 4:01 pm. Reason: Added [code] [/code] tags. Please use them to format any code that you post.
![]() |
Similar Threads
- Looking for PHP / MySQL Developer (Web Development Job Offers)
- Need Highly Experienced PHP/MySQL Programmer $15-$25/hour (Web Development Job Offers)
- PHP and MySQL query render time (PHP)
- PHP/MySQL Programmer Position (Web Development Job Offers)
- Double MySQL Query (PHP)
- MySQL++ query question (C++)
Other Threads in the PHP Forum
- Previous Thread: Ajax Tabs integrate SMF
- Next Thread: Restrict Image not to cache
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary broken buttons cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web websphere white xml youtube







Newbies prefer to skip the first post I believe ! Sigh.