User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 361,552 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,052 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 948 | Replies: 32 | Solved
Reply
Join Date: Nov 2007
Location: Bangalore, India
Posts: 2,861
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 7
Solved Threads: 205
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Maven

Re: Table aready exists

  #11  
Mar 31st, 2008
First of all, you are updating the table without any condition. So, it will update all the records and set broad1 = image/thumbs/thumb_1206960238.gif. Secondly, its echo $result['broad1'] and not echo $result ['$thumb_name'];
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Feb 2008
Posts: 259
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: Table aready exists

  #12  
Mar 31st, 2008
this is probably getting on your nerves now but it still does not display the image from the database i have now put an if statement on the update button so it will only try to put something in the database once the upload button is pressed.

the code for the display now looks like this

	$sql= "SELECT * FROM images_broad";
	     $query = mysql_query($sql)or die (mysql_error());
	     $result = mysql_fetch_array($query) or die (mysql_error());
	     echo $result ['broad1'];

on the page where it is supposed to display the image it gets to this section of the code and stops, there should be more text after this but the page does not fully display. it is not printing out any errors.
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 2,861
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 7
Solved Threads: 205
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Maven

Re: Table aready exists

  #13  
Mar 31st, 2008
Hmm.. Did you execute the query select * from images_broad in mysql console ? Did you get any output ?
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Feb 2008
Posts: 259
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: Table aready exists

  #14  
Mar 31st, 2008
i have just tried the print command on the section of code for displaying the image and this again came back with nothing. it loads the top part of the page but then dies when it gets to the php section.
Reply With Quote  
Join Date: Feb 2008
Posts: 259
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: Table aready exists

  #15  
Mar 31st, 2008
does mysql console only work if you are not using a remote server as all the files which i am creating are all held on a remote server. this might be a stupid question but i have never heard of this i hae just looked it up and it seems it will only work if a remote server is not being used.
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 2,861
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 7
Solved Threads: 205
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Maven

Re: Table aready exists

  #16  
Mar 31st, 2008
Well, I hope you have phpmyadmin atleast ? If you do, you can execute your query in phpmyadmin. You can use sqlyog to connect to remote server actually.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Feb 2008
Posts: 259
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: Table aready exists

  #17  
Mar 31st, 2008
no there is no phpadmin. i did not set the original site up i have just been asked to fix the problems the last person caused before he left. he did not do anything correct and all work i have had to fix of his up to now has all been half done.
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 2,861
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 7
Solved Threads: 205
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Maven

Re: Table aready exists

  #18  
Mar 31st, 2008
hmm.. In that case, try a simple script like this one.
  1. $query = "select * from images_broad";
  2. $result = mysql_query($query);
  3. if(mysql_num_rows($result) > 0){
  4. echo "There is something!"; //prints if there are more than 0 records
  5. } else {
  6. echo "There is nothing !"; // prints if there is nothing in the table
  7. }
Tellme what it prints.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Feb 2008
Posts: 259
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: Table aready exists

  #19  
Mar 31st, 2008
it has come back with there is nothing. when the image is uploaded it sets broad1 to the following

UPDATE images_broad SET broad1='image/thumbs/thumb_1206968603.gif'

is this not putting it into the database.
i have changed the update to insert to see if that changes anything and it giaves the same result.

could it have something to do with the files path?
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 2,861
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 7
Solved Threads: 205
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Maven

Re: Table aready exists

  #20  
Mar 31st, 2008
UPDATE images_broad SET broad1='image/thumbs/thumb_1206968603.gif'
That wouldn't put anything to the table, since your table has no records. Try this.
  1. $query = "insert into images_broad (broad1) values ('image/thumbs/thumb_1206968603.gif');
  2. mysql_query($query);
  3.  
Then execute the above script to check if a record exists or not. I am sure it will say, "There is something!" !
Last edited by nav33n : Mar 31st, 2008 at 9:22 am.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MySQL Marketplace
Thread Tools Display Modes

Other Threads in the MySQL Forum

All times are GMT -4. The time now is 1:57 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC