Jump to content

MySql Error, not sure why?


papillonstudios

Recommended Posts

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

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
		}
	}
}
}


?>

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.