| | |
mysql_num_rows(): error needs to work in 24 hrs mac :S thanks in advance
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 3
Reputation:
Solved Threads: 0
hello plz i need help with this urgently as it i supposed to be used tomorrow 
i get this error from the following script
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/aybasuco/public_html/MySQL-Formmaker/lib/db_index.inc.php on line 42
thanks in advance for your valiable time

i get this error from the following script
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/aybasuco/public_html/MySQL-Formmaker/lib/db_index.inc.php on line 42
thanks in advance for your valiable time
PHP Syntax (Toggle Plain Text)
<?php # MySQL-Formmaker 2002 by Kristof De Jaeger # swentel@realize.be # index page displaying databases. $error = ""; $dbname = ""; $description = ""; /* POST checking from new db insert if $_POST is set, otherwhise just form if everything is ok, redirect to table overview (which will be empty) otherwise, display errors etc */ if (isset($_POST["dbsubmit"])) { $dbname = trim($_POST["newdbname"]); if (empty($dbname)) $error .= translate("error1")."<br />"; if (eregi("[^[:alpha:]_]+",$dbname)) $error .= translate("error3")."<br />"; if (strlen($dbname) > 64) $error .= translate("error2")."<br />"; $found = in_array_cin($dbname); if ($found == 1) $error .= translate("error5")."<br />"; $query = "select db_name from formmaker_db where db_name = '".mq_add($dbname)."'"; $result = mysql_query($query); $row = mysql_fetch_object($result); if ($row) $error .= translate("error4")."<br />"; $description = $_POST["description"]; /* no errors -> insert & redirect to table index */ if ($error == false) { $query = "insert into formmaker_db values ('','$dbname','".nl2br(mq_add($_POST['description']))."','0')"; mysql_query($query); $dbid = mysql_insert_id(); header("location: index.php?formaction=table_index&dbid=$dbid"); } } include("header.inc.php"); /* display existing databases */ $query = "select db_id,db_name,db_description from formmaker_db order by db_name ASC"; $result = mysql_query($query); $rows = mysql_num_rows($result); if ($rows > 0) { echo '<span class="titles">'. translate("listofdbs").'</span><br /><br /> <table border="0" cellpadding="4" cellspacing="0"> <tr><td class="toprow">'.translate("name").'</td><td class="toprow">'.translate("description").'</td> <td class="toprow">'.translate("update").'</td><td class="toprow">'.translate("delete").'</td></tr>'; $foo = ''; while ($row = mysql_fetch_object($result)) { echo ' <tr> <td valign="top" class="list">'.mq_out($row->db_name).'</td> <td valign="top" class="list">'.mq_out($row->db_description).'</td> <td valign="top" class="list"><a href="index.php?formaction=table_index&dbid='.$row->db_id.'">'.translate("details").'</a></td> <td valign="top" class="list"><a onclick="return confirmdelete(\''.translate("deleteq1").'\')" href="index.php?formaction=db_del&dbid='.$row->db_id.'">'.translate("delete").'</a></td> </tr>'; } echo '</table>'; } else echo '<b>'.translate("nodbsyet").'</b>'; echo '<br /><br />'; # form form for creating new database echo '<span class="titles">'. translate("createnewdb").'</span> <form action="index.php" method="post">'; if (!empty($error)) echo '<span class="error">'.$error.'</span>'; echo '<p>'.translate("name").' : <br /><input type="text" value="'.mq_out($dbname,1).'" name="newdbname"></input><br /> * '.translate("help1").' * '.translate("dbeventcreate").'</p> <p>'.translate("description").' : <br /><textarea cols="50" rows="5" name="description">'.mq_out($description,1).'</textarea></p> <p><input type="submit" name="dbsubmit" value="'.translate("submitnewdb").'"></input></p> </form>'; include("footer.inc.php"); ?>
0
#2 Oct 31st, 2009
Did you even read the 'Read Me' topic at the top of the forum list?
http://www.daniweb.com/forums/thread191031.html
http://www.daniweb.com/forums/thread191031.html
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.
0
#4 Nov 1st, 2009
Perhaps the query on line 41 is not being executed.
It is very important to read this: http://www.catb.org/~esr/faqs/smart-questions.html
0
#5 Nov 1st, 2009
•
•
•
•
i read the link you provided and didn't get a solution
maybe i am doing something wrong
and so i started this topic for someone to help me as i am stuck in time
thanks for your fast reply ..appreciated
so could someone plz get what is wrong with the supplied argument in line 42 ?
thanks in advance
The problem is that the 'supplied argument is not a valid MySQL result resource'.
If you re-read the topic I linked to, you will see it tells you to add error-checking to your queries to tell you what they are not successful.
Add in the error checking and see what errors it gives you.
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: Oct 2009
Posts: 3
Reputation:
Solved Threads: 0
0
#6 Nov 3rd, 2009
for the urgent matter i said i used that google documents tools of creating forms and output in excel format
@ Dukane: i think so too
...and still to learn and find the mistake out i will try the error checking "Will" pointed to ..and will inform you with the results perhaps someone benifits from this
thanks alot Dukane & Will
@ Dukane: i think so too
...and still to learn and find the mistake out i will try the error checking "Will" pointed to ..and will inform you with the results perhaps someone benifits from this
thanks alot Dukane & Will
![]() |
Other Threads in the PHP Forum
- Previous Thread: Opening email client with pdf attached to it
- Next Thread: How to store files for a Content Management System (CMS)
Views: 309 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code codingproblem cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select send server sessions sms soap source space speed sql static structure syntax system table tutorial up-to-date update updates upload url validation validator variable video web wordpress xml youtube





