•
•
•
•
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
![]() |
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 2,861
Reputation:
Rep Power: 7
Solved Threads: 205
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*
*PM asking for help will be ignored*
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
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.
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.
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 2,861
Reputation:
Rep Power: 7
Solved Threads: 205
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*
*PM asking for help will be ignored*
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 2,861
Reputation:
Rep Power: 7
Solved Threads: 205
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*
*PM asking for help will be ignored*
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 2,861
Reputation:
Rep Power: 7
Solved Threads: 205
hmm.. In that case, try a simple script like this one.
Tellme what it prints.
php Syntax (Toggle Plain Text)
$query = "select * from images_broad"; $result = mysql_query($query); if(mysql_num_rows($result) > 0){ echo "There is something!"; //prints if there are more than 0 records } else { echo "There is nothing !"; // prints if there is nothing in the table }
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*
*PM asking for help will be ignored*
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?
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?
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 2,861
Reputation:
Rep Power: 7
Solved Threads: 205
•
•
•
•
UPDATE images_broad SET broad1='image/thumbs/thumb_1206968603.gif'
php Syntax (Toggle Plain Text)
$query = "insert into images_broad (broad1) values ('image/thumbs/thumb_1206968603.gif'); mysql_query($query);
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*
*PM asking for help will be ignored*
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
- Previous Thread: foreign keys
- Next Thread: creating tables



Linear Mode