DoggerWatson
-
Posts
11 -
Joined
-
Last visited
Never
Posts posted by DoggerWatson
-
-
[!--quoteo(post=376629:date=May 24 2006, 06:24 AM:name=predator12341)--][div class=\'quotetop\']QUOTE(predator12341 @ May 24 2006, 06:24 AM) [snapback]376629[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hey i aint full understanding your problem
are you tring to send data through the URL or what
[/quote]
Maybe this might make it clearer
These first two produce the desired result:
value in DB= John Jones
[a href=\"http://twilighttimes-publications.biz/catalogue2.php\" target=\"_blank\"]http://twilighttimes-publications.biz/catalogue2.php[/a]?[b]artistID=John[/b]&Submit=Go
value in DB= Judith Warr
[a href=\"http://twilighttimes-publications.biz/catalogue2.php\" target=\"_blank\"]http://twilighttimes-publications.biz/catalogue2.php[/a]?[b]artistID=Judith[/b]&Submit=Go
These two don't work
value in DB= <a href="http://www.site1.com/">Peter Smith</a>
[a href=\"http://twilighttimes-publications.biz/catalogue2.php\" target=\"_blank\"]http://twilighttimes-publications.biz/catalogue2.php[/a]?[b]artistID=%3Ca[/b]&Submit=Go
value in DB= <a href="http://www.site2.com/">Joe Bloggs</a>
[a href=\"http://twilighttimes-publications.biz/catalogue2.php\" target=\"_blank\"]http://twilighttimes-publications.biz/catalogue2.php[/a]?[b]artistID=%3Ca[/b]&Submit=Go
-
Thanks for the prompt response, but it still doesnt answer why
<a href="http://site1.biz/'>Name1</a>
<a href="http://site2.biz/'>Name2</a>
appear to return the same values wheras
name3 works
These are to populate a select list with values from the DB
which then displays the images associated with them
-
Outline:
I'm trying to get the results from a MySQL database & display them.
Just using
FROM
`books` WHERE image_by LIKE '%".$_GET ['artistID')."%' AND (books.Image_Sml != '/images/thumbs/NoImage_th.jpg' )";
Will not differentiate between <a href="http://site1.biz/'>name1</a>
and
<a href="http://site2.com/'>name2</a>
Gives me erroneous results, but works if the returned value is not an URL
SO I searched through the forum& figured that I needed to use htmlspecialchars as per below
NOW I get no results returned at all
$linkID = mysql_connect('localhost', 'Lida', 'ttb1lq')
or die(
"Error, database not accessing!");
mysql_select_db('twihjlight',$linkID);
$query = "SELECT
books.Id,
books.Titles,
books.image_by,
books.Image_Sml
FROM
`books` WHERE image_by LIKE '%".htmlspecialchars($_GET ['artistID'])."%' AND (books.Image_Sml != '/images/thumbs/NoImage_th.jpg' )";
if(!
$result = mysql_query($query, $linkID))
echo
mysql_error($linkID); //cry if the query fails -
All fixed...
Amazing what a bit of sleep can do
$pics="<a href=\"books_detail.php?recordID=" . $row["Id"] . "\">
<img src=\"" . $row["Image_Sml"] . "\" border=0 alt=\"" . $row["Titles"] . "\" >
</a>";
echo "<table border=0 width=100% >";
echo $pics ."</tr>";
echo "</table>";
-
G'day
This random image script works ok...but displays the resulys in a line horizontally.
How can I get them to appear below one another.
I've tried putting \n in every place I can think of & nada..
<?
// Connect to the database
mysql_connect ('localhost', 'root', 'sherlock') ;
mysql_select_db ('twihjlight');
// Edit this number to however many links you want displaying
$num_displayed = 4 ;
// Select random rows from the database
$result = mysql_query ("SELECT
books.Id,
books.Titles,
books.Image_Sml
FROM
books
WHERE
(books.Image_Sml != 'images/thumbs/NoImage_sml.jpg') ORDER BY RAND() LIMIT $num_displayed");
// For all the rows that you selected
while ($row = mysql_fetch_array($result))
{
// Display them to the screen...
echo "<a href=\"books_detail.php?recordID=" . $row["Id"] . "\">
<img src=\"" . $row["Image_Sml"] . "\" border=0 alt=\"" . $row["Titles"] . "\">
</a>";
}
?> -
G'day
I love this forum ...great place for noobie like me to pick up pointers & REAL help.
If I have a list /menu how can I populate it with the results from a query.
Theres about 40 possible values so far
eg bob, bill, mary etc & growing all the time.
There must be a simpler way than adding to the list of options.
Assume the db is test
table is product
field is name
Thanks in advance
Ken
-
Thank you Thank you Thank you
If I hadnt wasted so much time looking for complicated solutions I may have seen it.
Now my next post gets a little more complicated
-
G'day again
Can't see the forest for the trees...
If I use list/ menu box on the search page ..the url that is passed is
http://localhost.mysite/results.php?select =value& submit=go
What I need is
http://localhost.mysite/results.php?recordID=value
If I try it with a text box the url passes ok
What do I need to do differently in order to select a category from a list menu & pass that to the results page?
Create Database
in PHP Coding Help
Posted
Ok, i made a very simple test...
[code]<?php
mysql_connect("localhost","electri_ryan","*********");
mysql_query("CREATE DATABASE `forums`") or die(mysql_error());
?>[/code]
When i run this i get the error:
Access denied for user: 'electri_ryan@localhost' to database 'forums'
Do i have to set privileges or something? 'electri_ryan' has all privileges...
[/quote]
from 1 Noob to another Noob, if all you want to do is create a db; why not use the PHPMyAdmin from your CPanel. No point doing things the hard way.