
ROCKINDANO
Members-
Posts
143 -
Joined
-
Last visited
Never
Everything posted by ROCKINDANO
-
Hello all, I need some assistance in creating links for a calendar that is db driven. below are my tables schema: activities (actID int(20),actTitle varchar(100),actTime varchar(25),actPlace text,actBody text,actDate date,file text) can some one point me to the right direction? below is my query in my php file. $query="SELECT actID, actTitle, actTime, actPlace, actBody, date_format(actDate, '%W, %M, %d %Y') actDate, actDate as sortdate, file FROM activities WHERE actDate > '$today2' ORDER BY sortdate ASC"; $result=mysql_query($query); while($r=mysql_fetch_array($result)) { //modify these to match your mysql table columns $actID=$r["actID"]; $actTitle=$r["actTitle"]; $actBody=$r["actBody"]; $actDate=$r["actDate"]; $file=$r["file"]; $actTime=$r["actTime"]; $actPlace=$r["actPlace"]; HELP!!!
-
need help starting a db for and election page
ROCKINDANO replied to ROCKINDANO's topic in MySQL Help
Ok this is what i got. <table width="100%" border="1" cellspacing="1" cellpadding="0"> <tr> <td> </td> <?php if(!($db = @ mysql_connect('localhost', 'dvera', 'letdanin23'))) { print "Error: Could not connect to our database sorry for any inconvience.<br /> Please try at a later time."; } //select which database you want to edit mysql_select_db("elections"); $query = "SELECT * FROM locations"; $result = mysql_query($query); //goes through all records in database and retrieves the need ones. while($r=mysql_fetch_array($result)) { $LocationID=$r["LocationID"]; $Name=$r["Name"]; //displays all info only first three print "<td>".$Name."</td>"; }//end while loop print "</tr><tr>"; $query = "SELECT locations.LocationID, locations.Name, runners.RunnerID, runners.FirstName, runners.LastName, votes.VoteID, votes.Votes FROM locations, runners, votes WHERE locations.LocationID = votes.LocationID AND runners.RunnerID = votes.RunnerID"; $result = mysql_query($query); //goes through all records in database and retrieves the need ones. while($r=mysql_fetch_array($result)) { $RunnerID=$r["RunnerID"]; $FirstName=$r["FirstName"]; $LastName=$r["LastName"]; $VoteID=$r["VoteID"]; $LocationID=$r["LocationID"]; $RunnerID=$r["RunnerID"]; $Votes=$r["Votes"]; $Name=$r["Name"]; //displays all info only first three print '<td> ' .$FirstName. ' ' .$LastName. '</td>'; print "<td>" .$Votes. "</td>"; } ?> </tr> </table> but this is whats displayed Place 1 Place 2 Place 3 Place 4 Place 5 Place 6 Place 7 Runner1 255 Runner1 300 Runner2 200 I am trying to display a two row 7 column table. Runner2 should be on row 2 and his count on Place 2. any help? -
need help starting a db for and election page
ROCKINDANO replied to ROCKINDANO's topic in MySQL Help
I have seven polling location with one address. -
need help starting a db for and election page
ROCKINDANO replied to ROCKINDANO's topic in MySQL Help
on the location table, should i put address1 through address7? -
need help starting a db for and election page
ROCKINDANO replied to ROCKINDANO's topic in MySQL Help
Thank you so much i'll try to use this as a guide. -
Hello, I picked up a project to do a php page using mysql on and election race. this is the data that I need: There are 7 polling locations and 2 runners. I need to do a db for someone to enter the counts on to the db. i am having trouble coming up with the scheme for the db on how to have the votes for all 7 polling locations and tie them to the 2 runners. Any suggestions or can someone guide me to a start? Thank you in advance
-
script for uploading a group of pictures for slide show
ROCKINDANO posted a topic in PHP Coding Help
I am looking for help on guiding me to a way for a user to upload a group of pictures for a slide show. can some one help? I have a news page that a user is able to upload new stories or edit and upload one photo, but now i want that user to upload a group of pictures for a slideshow. hope all this makes sense. -
don't think this works when inserting into a database?
-
i have a php form where users can update db. but when the input has a <a href=""></a> input, it generates back slashes on the web. below is the results after the input. <a href=\'\\\"images/gallery/storyslideshow/ppic-5 (1).jpg\'\\\" rel=\'\\\"lyteshow[featgallery]\'\\\" title=\'\\\"\'\\\">View Slideshow</a><br><br> i have a this on my updating code mysql_real_escape_string($_POST["fulldesc"]);
-
i know, but the directory is there so why can't it upload them?
-
hello all, i moved my inhouse website to a hosting company. now i have a few files that i used to upload data to the website, but every time i try uploading it gives me this error. Warning: move_uploaded_file(..\pdfs\htdocs\pdfs\citysect/03152011CCRM.pdf) [function.move-uploaded-file]: failed to open stream: No such file or directory in /data/26/2/13/16/2502179/user/2740540/htdocs/loginscripts/uploadpdf.php on line 34 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/data/20/tmp_new/php2GMXs3' to '..\pdfs\htdocs\pdfs\citysect/03152011CCRM.pdf' in /data/26/2/13/16/2502179/user/2740540/htdocs/loginscripts/uploadpdf.php on line 34 could not moved can anyone help me?
-
Hello everyone, i am working on a page that displays news topic and would like to have the page numbers at the bottom of the page as links. You know the usual prev (link) then list couple of pages and then next (link). prev - 1 2 3 4 5... next below is the code i have to count my records on my db and display them. but the problem with this is that it displays all of them. page 1 through 50. $query2 = "SELECT COUNT(title) FROM news"; $result2 = mysql_query($query2); $row = mysql_fetch_row($result2); $total_records=$row[0]; $total_pages = ceil($total_records / 5); for ($i=1; $i<=$total_pages; $i++) { if ($i!=1 and $i !=10) { print "<a href='newsevents.php?page={$i}'> " .$i. " </a>"; } if ($i==$total_pages) { print"<p><a href='newsevents.php?page={$i}'> Last Page </a>"; } if ($i==1) { print "<p class='floatleft'><a href='newsevents.php?page={$i}'> First Page </a>"; } } Can someone help?
-
I am working on a asset project to insert, delete and view assets (items) that i owe. I am having trouble in the insert part. i have four tables department (DeptID, DeptName) DeptID is the primary key in this table. assetcategory (AssetCatID, AssestCategory) AssetCatID is the primary key in this table. asset (AssetID, AssetDescription, EmpID, AssetCatID, DeptID, Model, Maker, SerialNUm, DateAguired) AssetID is the primary key here. Employee (EmpID, FirstName, LastName) EmpID is the key here. and this is the code i have to insert using php. <?php if(isset($_POST['submit'])){ $FirstName = mysql_real_escape_string($_POST["FirstName"]); $LastName = mysql_real_escape_string($_POST["LastName"]); $DeptName = mysql_real_escape_string($_POST["DeptName"]); $AssetCategory = mysql_real_escape_string($_POST["AssetCategory"]); $Model = mysql_real_escape_string($_POST["Model"]); $Maker = mysql_real_escape_string($_POST["Maker"]); $SerialNum = mysql_real_escape_string($_POST["SerialNum"]); $DateAguired = mysql_real_escape_string($_POST["DateAguired"]); $AssetDescription = mysql_real_escape_string($_POST["AssetDescription"]); $AssetCatID = mysql_real_escape_string($_POST["AssetCatID"]); $AssetID = mysql_real_escape_string($_POST["AssetID"]); $EmpID = mysql_real_escape_string($_POST["EmpID"]); $DeptID = mysql_real_escape_string($_POST["DeptID"]); if(empty($FirstName) || empty($LastName) || empty($DeptName) || empty($AssetCategory) || empty($Model) || empty($Maker) || empty($SerialNum) || empty($DateAguired) || empty($AssetDescription)) { print "Please feel in all fields"; } else { ///insert into the department table.......... $query1= "INSERT INTO department VALUES (null,'{$DeptName}')"; $result1 = mysql_query($query1) or die(mysql_error()); $DeptID = mysql_insert_id(); //insert into the assetcategory table $query2= "INSERT INTO assetcategory VALUES (null,'{$AssetCategory}')"; $result2 = mysql_query($query2) or die(mysql_error()); $AssetCatID = mysql_insert_id(); //insert into the assets table $query3= "INSERT INTO assets VALUES (null,'{$AssetDescription}', '{$EmpID}','{$AssetCatID}','{$DeptID}','{$Model}','{$Maker}','{$SerialNum}','{$DateAguired}')"; $result3 = mysql_query($query3) or die(mysql_error()); $AssetCatID = mysql_insert_id(); print $query1; } } else { ?> the page is displaying this error: "Column 'AssetCatID' cannot be null" I would need help in inserting into all table required data. any help? hope i am making sense
-
I have a news table that holds news (news_id, title, fulldesc, file, newsdate) i have a query in my php file that selects all top ten stories, but want it with the date greater or equal to current date. or can someone point me to good news (stories) query sample?
-
Hello all, Need help with a news ticker that i have. it reads and grabs data from a mysql table fine. the problem is when i click on next more than once it moves to fast to the other story and not give chance to read. this is my js code page: // JavaScript Document first = 0; last = 10; current = 1; function nextStory() { // Hide current picture object = document.getElementById('slide' + current); object.style.display = 'none'; // Show next picture, if last, loop back to front if (current == last) { current = 1; } else { current++ } // alert(current); object = document.getElementById('slide' + current); object.style.display = 'block'; setTimeout(nextStory, 9000); } function previousStory() { // Hide current picture object = document.getElementById('slide' + current); object.style.display = 'none'; if (current == first) { current = last; } else { current--; } object = document.getElementById('slide' + current); object.style.display = 'block'; } this is my display php page. this is just the controls <div style="clear:both; position: relative; margin-top:-8px; margin-right:15px;" class="floatright"> <a href="javascript:previousStory()" style="margin-left: 10px;"> « Prev.</a> | <a href="javascript:nextStory()" style="margin-left: 10px;"> Next » </a> | <a href="latestnews.php" style="margin-left: 10px;">All News</a> </div> can someone help me?
-
yes but where would i insert the loop?
-
I am using session_start(). i just didn't include all the code for the entire page.
-
Hello everyone, I am working on a project for a client that requested for online employment. So far what i have is a login page (login.php), create an account (createaccnt.php) and view all jobs (alljobs.php). I want them to create an account first before applying or adding a job to their basket. Once the create an account they can view all jobs (alljobs.php). The all jobs page lists all the jobs with a check box to the right. i am trying to pass the job_id to the Employment Main menu (empmainmenu.php) when they click submit btn. the employment main menu displays their names, and a table with all the jobs that they have added. this is where i am having trouble. i can't get it to pass the job_id to the employment main menu page. can someone help me with this. maybe i am doing it wrong or there might be an easier way. below is my code for all my pages. alljobs.php page <body> <?php if(isset($_POST['submit'])) { $job_id = $_POST['job_id']; header('Location: login.php'); } ?> <form method="post" action="empmainmenu.php"> <?php if(!($db = @ mysql_connect('host', 'name', 'password'))) { echo 'Error: Could not connect to our database sorry for any inconvience.<br /> Please try at a later time.'; exit; } //select which database you want to edit mysql_select_db("job_site"); $apply = $_POST["checkbox"]; $query = "SELECT * FROM fulltime ORDER BY jobnum desc"; $result = mysql_query($query); print "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"table\">"; print "<tr align=\"center\" style=\"color:#FFFFFF\" bgcolor=\"#0066FF\">"; print "<td width=\"20%\">Title</td>"; print "<td width='30%'>Department</td>"; // print "<td width='21%'>Supervisor</td>"; print "<td width='13%'>Pay</td>"; print "<td width='13%'>Job#</td>"; print "<td width='13%'>Closing Date</td><td> </td>"; // print "<td width=\"22%\" align=\"center\"> View Job</td>"; print "</tr>"; print "<tr>"; print "<td width=\"100%\" colspan=\"6\">"; print "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">"; //goes through all records in database and retrieves the need ones. while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; //modify these to match your mysql table columns $job_id=$r["job_id"]; $department=$r["department"]; $supervisor=$r["supervisor"]; $title=$r["title"]; //displays all info only first three print "<tr><td width='20%'><a href='fullemp.php?job_id=$job_id'>".$title."</a></td>"; print "<td width=\"30%\" style=\"padding-left: 5px\">".$department."</td>"; // print "<td width='21%'>".$supervisor."</td>"; print "<td width=\"13%\" align=\"center\">".$pay=$r["pay"]."</td>"; print "<td width=\"13%\" align=\"center\">".$jobnum=$r["jobnum"]."</td>"; print "<td width=\"20%\" align=\"center\">".$closedate=$r["dataclose"]."</td> <td><input type='checkbox' name='checkbox' value='checked1' /></td></tr>"; // print "<td width=\"10%\" align=\"center\"><a href='fullemp.php?job_id=$job_id'>view</a></td></tr>"; }//end while loop print "</table>"; print "</td>"; print "</tr>"; print "</table>"; ?> <input type="submit" name="submit" value="submit" /> </form> </body> empmainmenu.php page <body> <?php $error = ""; //leave blank if(!isset($_SESSION["user_id"]) || !isset($_SESSION["ip_addr"])) die("Invalid operation!!!<br />Please login first<br /><a href=\"login.php\">Login</a>"); $user_id=$_SESSION["user_id"]; $ip_addr=$_SESSION["ip_addr"]; if($ip_addr != $_SERVER["REMOTE_ADDR"]) die("invalid operation!!!<br /> please login first"); if(!($db = @ mysql_connect('localhost', 'dvera', 'letdanin23'))) { print "Error: Could not connect to our database sorry for any inconvience.<br /> Please try at a later time."; } //select which database you want to edit mysql_select_db("employement"); $query = "SELECT * FROM users WHERE user_id='{$user_id}'"; $result = mysql_query($query); $num_result = mysql_num_rows($result); if($num_result == 0) die("Invalid operation <br /> Please login first"); $row = @ mysql_fetch_array($result); ?> <?php echo '<h3>Employement Main Menu</h3>'; ?> <a href="alljobs.php">View all Jobs Available</a><br /><a href="changeinfo.php">View/change your Contact Information</a><br /> <?php $job_id = $_POST['job_id']; print $job_id; echo '<p>Welcome, ' .$_SESSION['Fname']. ' ' .$_SESSION['Lname']. '</p>'; ?> <table width="100%" border="1" cellspacing="1" cellpadding="0"> <tr bgcolor="#000099"> <th style="color:#FFF;" colspan="4">Your saved jobs.</th> </tr> <?php if (!$db = mysql_connect('host','user','password')) { print "Error: could not connect to the database.<br>".mysql_error(); } mysql_select_db('employement') or die(mysql_error()); $query = "SELECT * FROM jobs WHERE jobs.user_id = '{$user_id}'"; $result = mysql_query($query); $num_result = mysql_num_rows($result); while ($r=mysql_fetch_array($result)) { $jobID=$r['jobID']; $user_id=$r['user_id']; $jobTitle=$r['jobTitle']; $jobNumber=$r['jobNumber']; $department=$r['department']; } if($num_result >= 1) { echo '<tr>'; echo '<td>' .$jobTitle. '</td>'; echo '<td>' .$jobNumber. '</td>'; echo '<td>' .$department. '</td>'; echo '<td> <a href="">View Status</td>'; echo '</tr>'; } else if($num_result == 0) { echo '<td><font style="color:#FF0000">You have no saved jobs</font>.</td>'; } ?> </table> <a href="logout.php">logout</a> </body>
-
Hello, I am trying to create a "A to Z" directory page on a web site that has a number of pages. I would like for the directory page to show a list displayed inline. Example of it here: abc | def | ghi etc.... so when clicked on the def link the page displays all the pages with those letters. Can someone help me with this, in showing me how to get started or point me a direction where i can get ideas on how to start or do this page?
-
Well Thank you.
-
is there a way to use the strip_tags() fun. and the $_REQUEST['parameter']. below is example of code. $message = strip_tags($_REQUEST['feedback']);
-
Hello all, I am working on a online request form that requires some fields to be filled. I understand that the mail() only takes 5 params. but since this is a online form, is there a way to include date of request, name, email, phone, location, service required, other, location details, location accessibility, and pole number? or can i combine a number of parameters into one var.? can someone help?
-
Hello, I am trying to set up two virtual hosts in my apache server, but having trouble. i have read the apache website and its little to confusing. this is what i am trying to do. I want to set it up in my local machine before putting it in my webserver and running the risk of bringing my web down. so this is what i have: # Use name-based virtual hosting. NameVirtualHost *:80 <VirtualHost *> ServerName Daniel_web.CityofEdinburg.local ServerAlias cityofedinburg.local *.cityofedinburg.local DocumentRoot "E:/Program Files/Apache Software Foundation/Apache2.2/htdocs/Edinburg site" </VirtualHost> <VirtualHost *> ServerName Daniel_web.CityofEdinburg.local ServerAlias cityweb1.local *.cityweb1.local DocumentRoot "G:/cityweb1" </VirtualHost> can someone help me here?
-
do i need any extra lib's or config in ini
ROCKINDANO replied to ROCKINDANO's topic in PHP Coding Help
could someone help me with this issues in this thread http://www.phpfreaks.com/forums/index.php/topic,280158.30.html -
do i need any extra lib's or config in ini
ROCKINDANO replied to ROCKINDANO's topic in PHP Coding Help
well i do have my gd2 dll in my php ini file. but for some reason my script works with someone else but not in my localhost