papillonstudios Posted August 5, 2009 Share Posted August 5, 2009 I am getting this mysql error after adding a page to my cms to add videos from youtube, veoh etc. Error message = Table 'test.videos' doesn't exist test = Database Name videos = Table Name My Code <?php //Checks to see if theyre allowed to edit their profile if ($uCan['admin']) { //Double security incase the admin hasn't set a guest membergroup if ($uId) { //If the form hasn't been submitted, show it. if (!$_POST['submit']) { ?> <p><h3>Media -> Add Video</h3></p> <br /> <form method="post"> <table width="50%"> <tr><td>Name of Video <?php echo form_input (text, name); ?></td></tr> <tr><td>Source of Video <?php echo form_input (text, source); ?></td></tr> <tr><td>Embed Code <?php echo form_textarea (30, 10, ebmed); ?></td></tr> <tr><td></td></tr> <tr><td>Video Desciption <?php echo form_textarea (40, 10, videodesc); ?></td></tr> <tr><td><?php echo form_button ('submit', 'submit', 'Add Video'); ?></td></tr> </table> </form> <?php } //Or else it has been submitted... else { //Get information from the forms secure it all. $name = secure($_POST['name']); $embed = secure($_POST['embed']); $source = secure($_POST['source']); $videodesc = secure($_POST['videodesc']); $post = mysql_query("INSERT INTO `videos` (name, source, embed,videodesc) VALUE ('$name', '$source', '$embed', '$videodesc')"); if ($post) echo 'The Video had been Added. Go to the Videos Page to view it. '.anchor('index.php?action=video', 'Videos'); else{ echo "Error message = ".mysql_error(); //A query to update everything } } } } ?> Link to comment https://forums.phpfreaks.com/topic/168883-mysql-error-not-sure-why/ Share on other sites More sharing options...
Maknis Posted August 5, 2009 Share Posted August 5, 2009 Do you have a Connection on that page? I am getting this mysql error after adding a page to my cms to add videos from youtube, veoh etc. Error message = Table 'test.videos' doesn't exist test = Database Name videos = Table Name My Code <?php //Checks to see if theyre allowed to edit their profile if ($uCan['admin']) { //Double security incase the admin hasn't set a guest membergroup if ($uId) { //If the form hasn't been submitted, show it. if (!$_POST['submit']) { ?> <p><h3>Media -> Add Video</h3></p> <br /> <form method="post"> <table width="50%"> <tr><td>Name of Video <?php echo form_input (text, name); ?></td></tr> <tr><td>Source of Video <?php echo form_input (text, source); ?></td></tr> <tr><td>Embed Code <?php echo form_textarea (30, 10, ebmed); ?></td></tr> <tr><td></td></tr> <tr><td>Video Desciption <?php echo form_textarea (40, 10, videodesc); ?></td></tr> <tr><td><?php echo form_button ('submit', 'submit', 'Add Video'); ?></td></tr> </table> </form> <?php } //Or else it has been submitted... else { //Get information from the forms secure it all. $name = secure($_POST['name']); $embed = secure($_POST['embed']); $source = secure($_POST['source']); $videodesc = secure($_POST['videodesc']); $post = mysql_query("INSERT INTO `videos` (name, source, embed,videodesc) VALUE ('$name', '$source', '$embed', '$videodesc')"); if ($post) echo 'The Video had been Added. Go to the Videos Page to view it. '.anchor('index.php?action=video', 'Videos'); else{ echo "Error message = ".mysql_error(); //A query to update everything } } } } ?> Link to comment https://forums.phpfreaks.com/topic/168883-mysql-error-not-sure-why/#findComment-891031 Share on other sites More sharing options...
papillonstudios Posted August 5, 2009 Author Share Posted August 5, 2009 Ya this page is included in the main index.php page via a switch statement. but why is it putting the database and table names together? Is really my question. Link to comment https://forums.phpfreaks.com/topic/168883-mysql-error-not-sure-why/#findComment-891035 Share on other sites More sharing options...
Maknis Posted August 5, 2009 Share Posted August 5, 2009 I beleive that is just how Mysql / Php reads it when you tell it to insert into a table its actually telling it to insert into the DB name . Table name the only thing i can see myself is a Case sensitivity error the table videos is defiantly all lower case? Ya this page is included in the main index.php page via a switch statement. but why is it putting the database and table names together? Is really my question. Link to comment https://forums.phpfreaks.com/topic/168883-mysql-error-not-sure-why/#findComment-891038 Share on other sites More sharing options...
papillonstudios Posted August 5, 2009 Author Share Posted August 5, 2009 ok but now this code structure is used for a lot of my pages and this is the only one doing this. Link to comment https://forums.phpfreaks.com/topic/168883-mysql-error-not-sure-why/#findComment-891040 Share on other sites More sharing options...
Maknis Posted August 5, 2009 Share Posted August 5, 2009 can you paste the page code here http://pastebin.com/ so we can see it BUT remember not to leave your passwords and stuff in if is there ok but now this code structure is used for a lot of my pages and this is the only one doing this. Link to comment https://forums.phpfreaks.com/topic/168883-mysql-error-not-sure-why/#findComment-891041 Share on other sites More sharing options...
papillonstudios Posted August 5, 2009 Author Share Posted August 5, 2009 http://pastebin.com/m6eef7bf5 Link to comment https://forums.phpfreaks.com/topic/168883-mysql-error-not-sure-why/#findComment-891051 Share on other sites More sharing options...
papillonstudios Posted August 5, 2009 Author Share Posted August 5, 2009 bump Link to comment https://forums.phpfreaks.com/topic/168883-mysql-error-not-sure-why/#findComment-891453 Share on other sites More sharing options...
papillonstudios Posted August 5, 2009 Author Share Posted August 5, 2009 please help! BUMP* Link to comment https://forums.phpfreaks.com/topic/168883-mysql-error-not-sure-why/#findComment-891694 Share on other sites More sharing options...
papillonstudios Posted August 7, 2009 Author Share Posted August 7, 2009 BUMP Link to comment https://forums.phpfreaks.com/topic/168883-mysql-error-not-sure-why/#findComment-892638 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.