corillo181 Posted December 7, 2007 Share Posted December 7, 2007 i have this code <?php function get_tn($id){ $query = "SELECT thumb_path FROM tra_artist_photo WHERE artist_id='$id'"; $result =$this->db->query($query); $tn_path = $this->db->fetch_array($result); return $tn_path['thumb_path']; } ?> the result of this is this [b]Query Error: Table 'travesurahouse_com.tra_artist_photo' doesn't exist[/b] this result is wrong because i do got the table in mysql .. [code] `tra_artist_photo` ( `photo_id` int(10) unsigned NOT NULL auto_increment, `artist_id` int(10) unsigned NOT NULL, `thumb_path` varchar(40) NOT NULL, `image_path` varchar(40) NOT NULL, `date` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`photo_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; [/code] Quote Link to comment Share on other sites More sharing options...
cunoodle2 Posted December 7, 2007 Share Posted December 7, 2007 Please show code on where you select your DB. For example... //this connects to the server using the user name and password $db = mysql_connect("localhost","username","password") or die("Could not connect!"); //this then selects the database mysql_select_db($db = "database_name") or die ("Could not select database"); Quote Link to comment Share on other sites More sharing options...
revraz Posted December 7, 2007 Share Posted December 7, 2007 Looks like you're using the wrong DB name. Quote Link to comment Share on other sites More sharing options...
corillo181 Posted December 8, 2007 Author Share Posted December 8, 2007 no thats not it, the only reason why i posted all that code is because of how sure i am about the database selection.. i only use one database and is used threw the website. so I'm 100% sure that the right database is selected. Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted December 8, 2007 Share Posted December 8, 2007 Do you have phpMyAdmin? If so, run this code. Take the screen output and copy it. Go to phpMyAdmin, load the database, and select the SQL tab from the main window. Paste in the copied text, select GO and let us know what phpMyAdmin says... paste the screen output here too. PhREEEk <?php function get_tn($id){ $query = "SELECT thumb_path FROM tra_artist_photo WHERE artist_id='$id'"; die("$query"); $result =$this->db->query($query); $tn_path = $this->db->fetch_array($result); return $tn_path['thumb_path']; } Quote Link to comment Share on other sites More sharing options...
corillo181 Posted December 12, 2007 Author Share Posted December 12, 2007 i found the problem, there was a white space in from of the table name it was hard to see, but i looked at it care fully and i saw the white space. so if any one is having a problem wher eyou have the table but can't selected watch out for any white space in the name. Quote Link to comment 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.