
maestrog
Members-
Posts
10 -
Joined
-
Last visited
Never
Everything posted by maestrog
-
$string ="yada yada yada<pre>This is what I wants to see!</pre>"; preg_match('/<pre.*?>(.*?[<pre.*?>.*<\/pre>]*)<\/pre>/', $string, $matches); echo $matches[1]; This outputs....This is what I wants to see! If I put these pre tags in mysql or any tags....$matches come up empty. Please help. I am running php 5.3.1 and it has stream filters I cannot turn off including "stream_tags.strip". I have a remote host running php5.0.4 which does not do this. I must get on with my regex work. Thanx for any help.
-
[solved]
-
Thanks for the help. I fixed some sloppy code earlier in my script...earlier query with the same variable name. Who knows how to post the "solved" thing?
-
That was a test...thats why it is commented out. I tried to update with manual values without the loop. It produced that same error. I now have gm$w-$j for the $enter value. I cannot even think of another way to do it. I usually work around problems, but this is a bugger.
-
Thanx, but no help yet. The space was so that variable would show up. Variables cannot start with an integer so I put gm first. Then $w$j would not show up unless I put something in the middle. I am looping through weekly picks with the $w and 16 game picks with the $j. I read in an mysql site that spaces are ok. I also know about the quotes. I tried quoting everything and anything. I am sure that the problem is in the game pick variable which is seen as an integer or something. I'm tellin ya, I'm ready for major drugs here. Should I attach the whole folder of files? Any more ideas are appreciated.
-
I have echoed all the field names to make sure they show properly. Let me know if you would like more..I only included this part of switch. I am trying to write nfl picks to database.Thanks for help. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 = REDSKINS WHERE id = '1' LIMIT 1' at line 1 <?php case "do_update": $p_name = $_POST['p_name']; $player = "player"; $entry = "INSERT INTO $player (name) VALUES ('$p_name')"; if ($_POST['p_name']) { $result = mysql_query($entry, $link) or die (mysql_error()); } $pick = $_POST["yo$w$j"]; $query2="SELECT * FROM $player WHERE name ='$p_name'"; $pid = mysql_query($query2, $link) or die (mysql_error()); $look = mysql_fetch_array($pid, MYSQL_ASSOC); $myid = $look[id]; /*$entered = "UPDATE $player SET gm1 1 = 'Giants' WHERE id ='10' LIMIT 1" ; $entered = "UPDATE $player SET gm1 1 = $pick WHERE id = '$myid'";//$p_name $result = mysql_query($entered, $link) or die (mysql_error());*/ for ($w = 1; $w < 18; ++$w){ $p_name = $_POST['p_name']; $weekly = "week_$w"; echo "<html><head><title>Update scores</title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>" ."<LINK media=screen href='includes/format.css' type=text/css rel=stylesheet></head><body>" ."<table width='646' border='1'><tr><td colspan='6' class=killer>Update Weekly Scores for $weekly for $p_name</td></tr>"; $query1="SELECT * FROM $weekly"; $result = mysql_query($query1, $link); $num=mysql_num_rows($result); $numb = $num + 1; for ($j = 1; $j < $numb; ++$j) { $enter = "gm$w $j"; $player = "player"; $pick = $_POST["yo$w$j"]; $entered = "UPDATE $player SET $enter = $pick WHERE id = '$myid' LIMIT 1";//help me..i am causing errors here! $result = mysql_query($entered, $link) or die (mysql_error()); $game = mysql_fetch_array($result, MYSQL_ASSOC) or die (mysql_error()); $id = $game[id]; echo "<html><head><LINK media=screen href='includes/format.css' type=text/css rel=stylesheet></head><body><table width='350'border='1'>" ."<tr><td class=nice height='20'width='94'>$pick</td><td class=nice width='40'>$enter</td>" ."<td class=nice width='94'></td><td class=nice width='40'></td></tr>" ."</table></body></html>"; } } break; } ?>
-
Simply put, I can echo all mysql row data inside the loop, but if I do a mail() inside the loop I mail once for every row. If I do a mail outside the loop, only my last row shows up. See, every sql row is a topic and text with that topic, but I can only print or echo it and not mail(). Any clearer?
-
I would like some help with something I always wanted to know. I am making a newsletter and cannot mail() outside of while loop...it mails the last row only. If I mail inside the loop, it mails for as many times as there are rows. Global is for variables and GLOBALS seems to be shunned. Any ideas would be appreciated. Also, how to identify a row by attaching its id#. <?php $edit = "SELECT top_id, title, title_size, text FROM $da_table"; $editor = mysql_query($edit, $link); while ($edi = mysql_fetch_array($editor , MYSQL_ASSOC)) { $id = $edi['top_id']; $tsize = $edi['title_size']; $title = $edi['title']; $text = $edi['text']; $body_new = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\n" ."<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" ."<head>\n" ."<title>my html</title>\n" ."</head>\n" ."<body topmargin=0><font face=$font size=$size color=$color><br />\n" ."<p><font size=$tsize>$title</font></p>" ."<p><font size=$font>$text</font></p>" ."<p><hr></p>" ."</body>\n" ."</html>\n"; } echo $body_new; ?>
-
I found the best book...PHP 5 fast&easy web development by Julie Meloni. I went thru it in 3 weeks. I took a Zend course, but should have read the book first. I just did a final four tournament project and am rolling. You have your eyes on a project and that is where it starts. This forum is great, too. My NCAA tournament is at http://maestrographics.net/mysql/FFour.php. Good Luck.
-
I have a tablerow "master" which contains the winners of the games in the final four basketball tourny. All the player pics are rows after the master. I want to loop through the players rows and if == to the master field..add 2 points to mpts which is the last field in the division. My +=2 operation is returning 222222222 for starters. I am all loooped out. Please help. $resultm = mysql_query("SELECT name, m1, m2, m3, m4, m5, m6, m7, mate, mpts FROM $table_name"); $resultmaster = mysql_query("SELECT name, m1, m2, m3, m4, m5, m6, m7, mate, mpts FROM $table_name WHERE name = 'master'");//midwest division-first round $num = mysql_num_rows($resultm); $rowm = mysql_fetch_array($resultmaster, MYSQL_ASSOC); $res = count($rowm); //$mid = "UPDATE $table_name SET //mpts = '$row[10]' WHERE id = '2'"; //$put = @mysql_query($mid,$connection) or die(mysql_error()); while($row = mysql_fetch_array($resultm, MYSQL_ASSOC)) { for ($counter=1; $counter<$num; $counter++) { //echo "{$row[name]}, {$row[m1]}, {$row[m2]}, {$row[m3]}, {$row[m4]}, {$row[m5]}, {$row[m6]}, {$row[m7]}, {$row[mate]} <br><br>"; for ($count=1; $count<10; $count++) { if ($row[$count] == $rowm[$count]) { $row[10] =+ 2; //$put; echo $row[10]; } } } } //Thanks from the maestro!