mclard
-
Posts
9 -
Joined
-
Last visited
Never
Posts posted by mclard
-
-
Just a blank screen...
-
Hi,
I have a mysql database containing 100 records, some of these records have a 'position' against them.
Im trying to get the following result....
1. A list containing 100 entries.
2. If li 1 has a 'position' against it, data is entered from the database, or it has default text, this is to carry on to li 100.
What ive got so far follows
$i = 1; if ($i<=100) { $SQL = "SELECT * FROM ws WHERE location ='$data' AND position ='$i'"; $result = mysql_query($SQL); while ($row=mysql_fetch_array($result)) { echo "<div><ul id='$i'>"; echo "<li id='$row[0]'>$row[4]</li>"; echo "</ul></div>"; } $i++; } else { echo "????"; }
Thanks
-
Thanks for the fast response
-
Hi,
Could anyone tell me the most efficient way to output data from a mysql database into a table in php so as i could output data so as after say 10 entries it starts a new table row.
Ive managed to fudge it in the past but having numerous if statements within a whill statement seemed a bit clumsy
if $row == 10 { echo "</tr><tr>"; $row++ } elseif $row ==20 etc.etc.etc
Thanks
-
Hi
Im trying to import the contents of a flat text file into a mysql database, what ive got so far kind of works but it only enters the first line. The more i look at it it looks like mysql syntax but im at a loss of what to do. Can anyone offer any advice.
FLAT FILE FORMAT...
entry1
entry2
entry3
[code]
$dbname="project";
$dbc = @mysql_connect ('localhost', 'root', '') or die (mysql_error());
@mysql_select_db("$dbname");
$SQL = "LOAD DATA LOCAL INFILE 'path to file' INTO TABLE `user` FIELDS TERMINATED BY ' ' ENCLOSED BY '' ESCAPED BY ' ' LINES TERMINATED BY '\r\n'";
$result = mysql_query($SQL);
[/code] -
Thanks, works a treat.
-
Hi
Im trying to get my code to list values from a mysql datatbase and for each item have a clickable button which points to a script to remove the item. So far ive got the following but it only ever passes the last item in the array to the delete script. Dunno if this is a long way round what im trying to do but hope someone can help.
Code follows:
[CODE]
$dbname="project";
$dbc = @mysql_connect ('localhost', 'root', '') or die (mysql_error());
@mysql_select_db("$dbname");
$query = "SELECT * FROM filterurl";
//run the query and handle the results
$result = @mysql_query($query, $dbc);
echo "<form method=post action='remove.php'><table>";
while($row=mysql_fetch_array($result)) {
echo "<tr><td>$row[1]</td><td><input type='submit' value='REMOVE'><input type='hidden' name='rmurl' value='$row'></tr>";
}
echo "</table></form>";
[/CODE]
Remove script
[CODE]
$rmurl = $_POST['rmurl'];
echo $rmurl;
$dbname="project";
$dbc = @mysql_connect ('localhost', 'root', '') or die (mysql_error());
@mysql_select_db("$dbname");
$SQL = "DELETE FROM filterurl WHERE url = $rmurl";
$result = mysql_query($SQL);
header("Location: filterdisplay.php");
[/CODE] -
are you hosting the webserver locally?
Php and li
in PHP Coding Help
Posted
If i use
I get some output but not the right one...
What i get in the page source is
And what id hope to get is
Thanks