ankur0101 Posted April 18, 2009 Author Share Posted April 18, 2009 Now showing different error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-813190 Share on other sites More sharing options...
Axeia Posted April 18, 2009 Share Posted April 18, 2009 Something is wrong with the query itself, echo it out and keep trying in PHPmyadmin or some other mysql frontend till it's fixed. Then fix it in your code. Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-813197 Share on other sites More sharing options...
Mchl Posted April 18, 2009 Share Posted April 18, 2009 I am willing to bet, that $roll_number is empty. Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-813206 Share on other sites More sharing options...
ankur0101 Posted April 18, 2009 Author Share Posted April 18, 2009 No, its not empty, I have entered a record from backed My database is not empty Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-813331 Share on other sites More sharing options...
.josh Posted April 18, 2009 Share Posted April 18, 2009 well everything else in your query string is hardcoded, so that leaves your variable. Echo out your variable before the query. Does it echo what it's supposed to? Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-813338 Share on other sites More sharing options...
ankur0101 Posted April 19, 2009 Author Share Posted April 19, 2009 well everything else in your query string is hardcoded, so that leaves your variable. Echo out your variable before the query. Does it echo what it's supposed to? Echo it out ... what does that mean ? Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-813662 Share on other sites More sharing options...
Mchl Posted April 20, 2009 Share Posted April 20, 2009 Use echo to display its value. Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814331 Share on other sites More sharing options...
ankur0101 Posted April 20, 2009 Author Share Posted April 20, 2009 Im damn confused .. can anybody solve this problem ? What changes I have to do in my pages , please sir can you tell me with code ? Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814440 Share on other sites More sharing options...
trq Posted April 20, 2009 Share Posted April 20, 2009 As has been stated, you need to echo out your query and take a look at it to determine what is wrong with it. Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814452 Share on other sites More sharing options...
ankur0101 Posted April 20, 2009 Author Share Posted April 20, 2009 Ok thanks I will do so. I will also screen shots Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814455 Share on other sites More sharing options...
ankur0101 Posted April 20, 2009 Author Share Posted April 20, 2009 Screen shot of database Screen shot of index.php Screen shot of Result Page Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814519 Share on other sites More sharing options...
Mchl Posted April 20, 2009 Share Posted April 20, 2009 The variable in your form is called 'roll_no_textbook' and in the script 'roll_no'. Decide on one. Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814523 Share on other sites More sharing options...
ankur0101 Posted April 20, 2009 Author Share Posted April 20, 2009 the name and ID of textbox is roll_no_textbox Name of table is roll_no Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814533 Share on other sites More sharing options...
ankur0101 Posted April 20, 2009 Author Share Posted April 20, 2009 Is this code is working on your PC / Server ? Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814535 Share on other sites More sharing options...
Mchl Posted April 20, 2009 Share Posted April 20, 2009 Sorry... I got lost in your code... But I guess I've found the issue This is in your index.php <form id="form1" name="form1" method="post" action="result.php"> <div align="center"> <label>Roll Number : <input type="text" name="roll_no_textbox" id="roll_no_textbox" /> </label> <label> <input type="submit" name="button" id="button" value="search" /> </label> </div> </form> As you can see it uses method="post" This is in your result.php $roll_number = $_GET['roll_no_textbox']; Ooops... it uses $_GET instead of $_POST Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814538 Share on other sites More sharing options...
ankur0101 Posted April 20, 2009 Author Share Posted April 20, 2009 Now new error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-table WHERE roll_no =' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814556 Share on other sites More sharing options...
Mchl Posted April 20, 2009 Share Posted April 20, 2009 Well? You should be able to fix that one by yourself. It's pretty obvious. Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814573 Share on other sites More sharing options...
ankur0101 Posted April 20, 2009 Author Share Posted April 20, 2009 Ohh, Im getting rid of these errors I created new table "resulttable" Put the all data of result-table Now showing 1 more error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 When I click submit button, it opens result.php instead of reault.php?roll_no=1 Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814582 Share on other sites More sharing options...
Mchl Posted April 20, 2009 Share Posted April 20, 2009 I created new table "resulttable" Put the all data of result-table Changing the query to use 'result_table' instead of 'result-table' would be enough... Now showing 1 more error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Which file? Which line? When I click submit button, it opens result.php instead of reault.php?roll_no=1 That's how method="post" works. Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-814591 Share on other sites More sharing options...
ankur0101 Posted April 22, 2009 Author Share Posted April 22, 2009 HIP HIP HURREYYY .... :D :D :D :D :D ITS NOW WORKING FINE :D :D ;D WHAT I LEARNED IS .>>>>>>>> Always Keep in mind what I am writing Make sure that both PHP and SQL syntax are correct So what was the problem ? I wrote incorrect SQL syntax, My database table name was "result-table" I changed it to "resulttable" Now its working , I am damn happy, thank you all friends ...... Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-816347 Share on other sites More sharing options...
hyper Posted July 19, 2011 Share Posted July 19, 2011 Ankur can you please share the working code? I need this badly. Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-1244843 Share on other sites More sharing options...
Maq Posted July 19, 2011 Share Posted July 19, 2011 Ankur can you please share the working code? I need this badly. I'd suggest creating a new thread with your code and the specific issue you're experiencing. Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-1244850 Share on other sites More sharing options...
Obison Posted April 28, 2013 Share Posted April 28, 2013 am confuse here .were is the mysql table for this tutorial . i have been looking for a way to do this and am finding it difficult.i need assistance with this php script am new in php and this my project work assignment ,if you wish to help me you can contact me obilor4mummy@gmail.com Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-1426926 Share on other sites More sharing options...
GowthamPrabhu Posted June 22, 2013 Share Posted June 22, 2013 Hi friends, I am trying to implement the same feauture of displaying results, actually i want to display the details of the students. i have database named as friends and table named as friendss the table contains field names such as srollno - Roll No sname- Name rme- phone Nmber mailme- Maill Address what I want is if i give their rollno in a text box their details should be displayed. can anyone help me in this. Also i want to display their photo , the name of the photo is same as roll number and the photos are saved under images folder. please help me contact address miles2gogowtham@gmail.com Quote Link to comment https://forums.phpfreaks.com/topic/135906-solved-exam-results-script-please-help-me/page/2/#findComment-1437353 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.