sasa
Staff Alumni-
Posts
2,804 -
Joined
-
Last visited
-
Days Won
1
Everything posted by sasa
-
if ($row3['next_breed'] < $today){ is it Ok i think thet you must use >
-
try [code]$detailpress = mysql_query("SELECT * FROM press WHERE id= {$_GET['pressid']}") or die(mysql_error());[/code]
-
try [code]$today = date ('Y-m-d', strtotime ("U"));[/code]
-
try[code]<?php echo "<form name='attendance' action='$_SERVER[PHP_SELF]' method='POST'>"; echo "<input type='submit' value='Submit Changes'>"; $i=0; echo '<table>'; while ($row=mysql_fetch_row($result1)) { $IDstudent=$row[0]; $name = $row[1]; $status = $row[2]; echo " <tr> <td> <input name='studentid[{$i}]' type='hidden' value='{$IDstudent}'> </td> <td> {$name} </td> <td> {$status} </td> <td> <input name='status[{$i}]' type='radio' value='P'";echo $x =(strtolower($status) == 'p') ? "checked='checked'" : ''; echo "> Present </td> <td> <input name='status[{$i}]' type='radio' value='T'"; echo $x =(strtolower($status) == 't') ? "checked='checked'" : ''; echo "> Tardy </td> <td> <input name='status[{$i}]' type='radio' value='U'"; echo $x = (strtolower($status) == 'u') ? "checked='checked'" : ''; echo "> Unexcused Absence </td> <td> <input name='status[{$i}]' type='radio' value='E'"; echo $x = (strtolower($status) == 'e') ? "checked='checked'" : ''; echo "> Excused Absence </td> </tr>"; $i++; } echo "</table>"; ?>[/code]
-
Help with the dreaded multidimensional associative array extract
sasa replied to tcicatelli's topic in PHP Coding Help
TRY [CODE]<?php $a = array( "client_info" => array("client_fname" => "John", "client_lname" => "Smith"), "laundry" => array("Shirt" => array("color" => "red", "status" => "clean"), "Pants" => array("color" => "blue", "status" => "dirty") ) ); foreach ($a['laundry'] as $k => $v) { $b[] = "('$k', '{$v[color]}', '{$v[status]}')"; } $b = implode(', ', $b); $sql = "INSERT INTO Inventory (Item, Color, Status ) VALUES {$b}"; echo $sql; ?>[/CODE] -
Need to insert category ID # into database... not category name... how?
sasa replied to simcoweb's topic in PHP Coding Help
try to change your form [code] <select id="DropDown1" style="WIDTH: 230px" name="category"> <option value="1" selected="selected">Marketing <option value="2">Professional Services <option value="3">Health & Wellness <option value="4">Home Design & Improvements </select> [/code]where is 1 id of category Marketing etc. -
Barand mean $data[] = $row; in line 8 in 2nd part of code
-
try [code]foreach ($arr as $value) echo implode(' ',$value);[/code]
-
try to echo $sql before query what is say
-
1 st change [code]$totalrows = mysql_num_rows($result_count); [/code]to [code]$totalrows = mysql_result($result_count,0,0); [/code] 2nd change[code]$pageprev = $page--; [/code]to[code]$pageprev = $page-1; [/code]
-
look http://www.server2go-web.de/index.html
-
can you post structure of your db
-
try[code]$sql = 'SELECT @x := x, @y := y' . ' FROM registred' . ' WHERE areaname = ''london'';' . ' SELECT *, (' . ' x - @x' . ' ) * ( x - @x ) + ( y - @y ) * ( y - @y ) AS distanc FROM `registred`' . ' ORDER BY distanc ASC' . ' LIMIT 0 , 10';[/code]
-
try 'select runningtotal as Total from orders'
-
try[code]foreach ($rows as $k => $data) { switch ($k) { case 'UnitPrice': case 'RunningTotal': $data = '£ '.$data; break; case 'Qty': $data = 'off '.$data; break; case 'Orderdate': $data = date("j-M-Y", strtotime($data)); } echo "<td align='left'><font face='Arial' size='5'>". $data . "</font></td>"; }[/code]
-
using count function on a session array variable [SOLVED]
sasa replied to phpbenny's topic in PHP Coding Help
try[code]<?php $_SESSION["kurv"][0][0] = 5; $_SESSION["kurv"][0][1] = 3; $_SESSION["kurv"][1][0] = 1; $_SESSION["kurv"][2][3] = 25; function multi_count($a) { if (!isset($a)) return 0; if (is_array($a)) foreach ($a as $b) $count += multi_count($b); else $count = 1; return $count; } echo multi_count($_SESSION["kurv"]); ?>[/code] -
try[code] .... for ($i = 0; $i < count($type); ++$i) { mysql_data_seek($products_query,0); while ($products = mysql_fetch_array($products_query)) ....[/code]
-
[code]change[codevar_dump(is_dir($image));][/code]to[code]var_dump(is_dir($rootdir.'/'.$image));[/code]
-
look http://www.phpfreaks.com/forums/index.php/topic,103521.0.html
-
can you print_r($_POST['sn'];
-
in line [code]while($feature = mysql_fetch_assoc($sql_features)); { ?>[/code]remove ;
-
[quote author=HuggieBear link=topic=108672.msg438175#msg438175 date=1158772837] It's a typo, change that line to... [code=php:0]if($name != $tmp_name){[/code] Regards Huggie [/quote]thanks HuggieBear
-
try[code]<table width="100%" cellpadding="2" cellspacing="1" border="1" id="CBT Report"> <tr id="Labels"> <th width="10%" align="left" valign="bottom" class="style2">Name</th> <th width="10%" align="left" valign="bottom" class="style2">Date</th> <th width="8%" align="left" valign="bottom" class="style2">Time</th> <th width="12%" align="left" valign="bottom" class="style2">Email</th> </tr> <?php $tmp_name=''; do { ?> <tr class="style2" id="ReportInfo"> <?php $name = ucwords($row_report['first_name'])." ".ucwords($row_report['last_name']); if($name != $tmp:name){ ?> <td width="10%" height="23" valign="top"><?php echo ucwords($row_report['first_name'])." ".ucwords($row_report['last_name']); ?></td> //only want one occurance of this from database <?php } else echo '<td width="10%" height="23" valign="top"> </td>'; $tmp_name = $name; ?> <td valign="top" width="10%"><?php echo $row_report['date']; ?></td> <td valign="top" width="8%"><?php echo $row_report['time']; ?></td> <td valign="top" width="12%"><?php echo $row_report['email']; ?></td> </tr><?php } while ($row_report = mysql_fetch_assoc($report)); ?> </table>[/code]
-
try[code]<?php $row = array(); $PicPart1 = "http://www.legacyrealtypros.com/ListPic/"; $PicPart3 = "/Tum1.JPG"; $dbh=mysql_connect ("localhost", "USER", "PASS") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("User"); if(!isset($_GET['page'])) $page = 1; else $page = $_GET['page']; $max_results = 4; $from = (($page * $max_results) - $max_results); $sql = mysql_query("SELECT * FROM Listings LIMIT $from, $max_results"); While ($row = mysql_fetch_array($sql)){ $ListingID = $row['ListingID']; $Address = $row['Address']; $City = $row['City'] ; $State = $row['State'] ; $ZipCode = $row['ZipCode']; $SchoolDist = $row['SchoolDist']; $Price = $row['Price']; $Rooms = $row['Rooms']; $Bathrooms = $row['Bathrooms']; $Sq_ft = $row['Sq_ft']; $Agent = $row['Agent']; $PicPart2 = $ListingID; $PicFinal = $PicPart1 . $PicPart2 . $PicPart3; $Display = "<img src=\"$PicFinal\"> "; echo "<a href=\"lrplist.php?ListingID=$ListingID\">$Display</a>"; echo ("Address: $Address, $City , $State, School District: $SchoolDist"); echo ("Price: $Price , Rooms: $Rooms, Bathrooms: $Bathrooms, Sqr FT: $Sq_ft"); echo (" Agent: $Agent"); } $total_results = mysql_results(mysql_query("SELECT COUNT (*) as Num FROM pages"), 0); $total_pages = ceil($total_results / $max_results); echo "<center>Select a Page"; if($page > 1){ $prev = ($page - 1); echo "<a href= \"" . $_SERVER['PHP_SELF'] . "?page=$prev><Previous</a> "; } for($i = 1; $i <= $total_pages; $i++){ if(($page) == $i){ echo "| $i "; } else { echo "| <a href= \"".$_SERVER['PHP_SELF']."?page=$i\">$i</a> "; } } if($page < $total_pages){ $next = $page + 1; echo "| <a href= \"". $_SERVER['PHP_SELF'] . "?page=$next\">Next></a>"; } else echo '|'; ?>[/code]