General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 19th, 2003, 05:46 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
problem with retrieving data

I have a problem, I've had it before but I can't figure out what I did to solve it before. Whenever I load my movieupdate page, which is just an include() in my index page, I get this error:

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in c:\phpdev\www\prp\movieupdate.php on line 4

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in c:\phpdev\www\prp\movieupdate.php on line 6
Table 'movies.online' doesn't exist

I can't figure out what the problem is. I don't know why it's giving me these errors, and why it would look for movies.online, becuase it's true, it doesn't exist. I don't know where it gets that diea at all. here is the code for movieupdate page.

PHP Code:
<?php ob_start();
require_once(
'Connections/movies.php'); ?>
<?php
mysql_select_db
($database_movies$movies);
$query_Recordset1 "SELECT * FROM movieinfo";
$Recordset1 mysql_query($query_Recordset1$movies) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);
?>
<?php 
    
    $movieResult 
= @mysql_query("select * from movieinfo order by movieName ASC");

        if(
$IsLoggedIn)
    {
    
        while(
$movieRow mysql_fetch_array($movieResult))
        { global 
$movieRow;
        
            echo 
'<img src="pics/moviepics/$movieRow[3]/coverbox/$movieRow[4]">';
        } 
    } else {
        echo 
"No Users Are Currently Logged In... so stop procrastinating and"?>

<a href="index.php?page=login"> Login</a> <?php echo "!";
        }

?>

Any ideas?
__________________
hey it's the CHARKING

Reply With Quote
  #2  
Old June 19th, 2003, 06:48 PM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
Post the code that is before this script is included.
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
  #3  
Old June 19th, 2003, 09:39 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
i solved it... somehow

well i decided to just comment out the connection code... and that seemed to work... but this page doesn't require info to be sent to the db, just retrieved.
Then I realized that I was having a similar problem with a page that requires a database connection in order to send info to it. With the conenction info, it will give me the error message like before. Without the connection info, the page loads and seems to work fine, but no data is put into the db. It is treated jsut as the page from before, as an include. Here is the code for that page, and the page before it. There are actually a lot of pages before these,
thanks so much!

PHP Code:
//page that is malfunctioning
<?php 
ob_start
();
require_once(
'Connections/movies.php'); ?>
<?php
mysql_select_db
($database_movies$movies);
$query_Recordset1 "SELECT * FROM movieinfo, moviepics, poll";
$Recordset1 mysql_query($query_Recordset1$movies) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);

        
            if(
$_COOKIE['auth'] < 5)
        {
            echo 
'Sorry, you do not have the Administrative capabilities required to perfrom this function.';
            echo 
'This may be due to restrictions on your account, or that you have not <a href="index.php?page=login">Logged In</a>.<br>';
            echo 
'<a href="index.php">Home</a>  ||  ';
            echo 
'<a href="index.php?page=register">Join</a>';
            exit;
        }
            
            if (isset(
$_COOKIE['auth']))
            {    if(
$_COOKIE['auth'] < 5)
        {
            echo 
'Sorry, you do not have the Administrative capabilities required to perfrom this function.';
            echo 
'This may be due to restrictions on your account, or that you have not <a href="index.php?page=login">Logged In</a>.<br>';
            echo 
'<a href="index.php">Home</a>  ||  ';
            echo 
'<a href="index.php?page=register">Join</a>';
        } else {
            if(
$_POST['what'] == 'process')
                {
                    
$strQuery "INSERT INTO movieinfo (";
                    
$strQuery .= "`movieName`, `moviePicName`, `director`, `starring`, `runningTime`, `format`, `released`, `rating`, `officialSite`, `reviewtext`, `reviewRating`) VALUES (";
                    
$strQuery .= "'{$_POST['strMovieTitle']}', '{$POST_['strMoviePicName']}', '{$_POST['strDirector']}', '{$_POST['strStarring']}', '{$_POST['strRunningTime']}', '{$_POST['strFormat']}', '{$_POST['strReleased']}', '{$_POST['strRating']}', '{$_POST['strOfficialSite']}', '{$_POST['strReviewText']}', '{$_POST['strReviewRating']}')";
                    
mysql_query($strQuery);
                
?>
<tr><td width='100%' bgcolor='#66B4F4'>Review Added</td></tr>
<tr><td>You have successfully added your review into the Database 
<a href="index.php">Continue</a></td></tr> 
    <?php
} else { 
    
?>

                        <span class="title"><tr><td width='100%' bgcolor='#66B4F4'>Add Movie Review</td></tr></span>

                        <table width="97%" border="0">
                        <!--<a href="index.php?page=getfiles">*Upload a Picture*</a> -->
                            <form action="index.php?page=addmovie" method="post">
                            <input type="hidden" name="what" value="process">
                            <tr>
                                
      <td width="45%"><strong>Movie Title</strong></td>
                                <td width="55%"><input name="strMovieTitle" type="text" value=""></td>
                            </tr>
                            <tr>
                                
      <td width="45%"><strong>Movie Picture Name</strong></td>
                                <td width="55%"><input name="strMoviePicName" type="text" value=""></td>
                            </tr>
                            <tr>
                                
      <td width="45%"><strong>Director</strong></td>
                                <td><input type="text" name="strDirector" value=""></td>
                            </tr>
                            <tr>
                                
      <td width="45%" height="28"><strong>Starring</strong></td>
                                <td><textarea name="strStarring"></textarea></td>
                            </tr>
                            <tr>
                                
      <td width="45%"><strong>Running Time</strong></td>
                                <td><input type="text" name="strRunningTime" value="[## hrs, ## mins]"></td>
                            </tr>
                            <tr>
                                
      <td width="45%"><strong>Format</strong></td>
        
      <td> 
        <select name="strFormat" size="1">
          <option value="VHS">VHS</option>
          <option value="DVDWS">DVD - WideScreen</option>
          <option value="DVDFS">DVD - FullScreen</option>
        </select></td>
                            </tr>
                            <tr>
                                
      <td width="45%"><strong>Released</strong></td>
                                <td><input type="text" name="strReleased" value="[mm/dd/yyyy]"></td>
                            </tr>

                            <tr>
      <td width="45%" height="26"><strong>Rating</strong></td>
                                
      <td> 
        <select name="strRating">
          <option value="G">G</option>
          <option value="PG">PG</option>
          <option value="PG13">PG-13</option>
          <option value="R">R</option>
          <option value="NC17">NC-17</option>
        </select></td>
                            </tr>
                            <tr>
      <td width="45%"><strong>Official Site</strong></td>
                                <td><input type="text" name="strOfficialSite" value=""></td>
                            </tr>
                            <tr>
      <td width="45%" height="26"><strong>Review Rating</strong></td>
                                
      <td> 
        <select name="strReviewRating">
          <option value="1 Stars">1 Stars</option>
          <option value="2 Stars">2 Stars</option>
          <option value="3 Stars">3 Stars</option>
          <option value="4 Stars">4 Stars</option>
          <option value="5 Stars">5 Stars</option>
        </select></td>
                            </tr>
                            <tr>
      <td width="45%">&nbsp;</td>
      <td> 
        <textarea name="strReviewText" cols="45" rows="08" id="ReviewText">[Paste or Write your movie review here]</textarea></td>
                            </tr>
                            <tr>
                                <td width="45%"></td>
                                
      <td><input name="submit" type="submit" value="Add"></td>
                            </tr>
                            </form>
                        </table>

                    <?php
                    
}
                }
            }
        
?> 

the page before it:
PHP Code:
<?php require_once('Connections/users.php'); ?>
<?php
mysql_select_db
($database_users$users);
$query_Recordset1 "SELECT * FROM users";
$Recordset1 mysql_query($query_Recordset1$users) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);

if(
$IsLoggedIn)
 {
  
$levelName = @mysql_query("SELECT * FROM users WHERE username = '" $details[1] . "'");
    while (
$levelRow mysql_fetch_row($levelName))
     { 
$levelName2 $levelRow[8]; }
if(isset(
$_COOKIE['auth']))
    { if(
$_COOKIE['auth'] == 5)
        { echo 
"<tr><td width='100%' bgcolor='#66B4F4'>
        <center>Administrators Section</center></td></tr>"
;
            } else {
          echo 
"<tr><td width='100%' bgcolor='#66B4F4'>
          <center>Members Section</center></td><tr>"
;
            } 
          } 
         } else {
             
$levelName "Guest";
          echo 
"<tr><td width='100%' bgcolor='#66B4F4'>
          <center>Guests' Section</center></td></tr>"
;
    }
    echo 
'<tr><td><center>
    <a href="index.php?page=search">Search</a></center></td></tr>'
;
if(
$IsLoggedIn)
    { 
?>

<tr><td width='100%' bgcolor='#66B4F4'>
<center>Status : <?php echo $levelName2?></center></td></tr>
<tr><td><center><?php echo '<a href="index.php?page=viewprofile&userid=' $roomwithaview '">View Profile</a> || <a href="index.php?page=editprofile&strMethod=' $edit '">Edit Profile</a> || <a href="index.php?page=login&strMethod=logout">Log Out</a>';?></td></tr>
    <?php    
    
if (isset($_COOKIE['auth']))
        { if (
$_COOKIE['auth'] == 5)
            { 
?><tr><td><center>
    <a href="index.php?page=addmovie">Add Movie Review</a>  ||  <a href="index.php?page=viewall">Edit Accounts</a>
    </center></td></tr> <?php } } } else {
?> <tr><td width='100%' bgcolor='#66B4F4'>
<center>Status : <?php echo $levelName?></center></td></tr>
<tr><td><center><a href="index.php?page=registration">Join</a> || <a href="index.php?page=login">Login</a></center></td></tr>
        <?php }
         
?>
         </center></td></tr>
<tr><td width='100%' bgcolor='#66B4F4'>
<center>Recently Updated</center>
</td></tr>


Okay and I jsut tried commenting out the recently included files in my index.php page, becuase I know that this addmovie page was working shortly before those. In fact the other pages don't really make use of the database that addmovie does, along with the page I initially had problems with, movieupdate.php. I think that's the problem. I also checked the status of my conenctions and found that there were many sleeping due to having a mysql_pconnect() command in the file to use the movies database... I assumed this was the problem, the reason why it was having trouble grabbing info was that it was trying to use to dbs at once (hence table movies.online not exisitng). okay I hope this made sense and that you guys can help me out thanks!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > problem with retrieving data


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT