473,396 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

detecting path from Mysql

imarkdesigns
hello again guys... im in trouble here in my coding which i cannot open a link for the end user of the page in the site where there is a portal thru the folder... [sorry for my english ahehe..]

anyway, here is my code...

//-- for the table linkage with icon
Expand|Select|Wrap|Line Numbers
  1. <table>
  2. <tr>
  3. <td class="rowsavedisk"> <a href="<? echo $dirPath.$rows['name']; ?>" target="_blank" title="Poster"> <img src="imgs/icons/save.gif" alt="" border="0" /> </a> </td>
  4. </tr>
  5. </table>
however, when the database name and path are empty, i need to disable the current linkage in my table like this:

//-- for the table linkage with icon

Expand|Select|Wrap|Line Numbers
  1. <table>
  2. <tr>
  3. <td class="rowsavedisk"> </td>
  4. </tr>
  5. </table>
where there is no open link when the name and path of the database are empty... now i wish that someone can help me to correct my code...

here is my code for the path-link:

//--
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $source = $name . $path;
  4.  
  5. $query = "SELECT id, name, path FROM $sched LIMIT 1";
  6. $result = mysql_query($query) or die('Error, query failed');
  7. if($source == 0) {
  8. // empty space or no content instead
  9. echo "";
  10. } else {
  11. // include this path if the result is 1
  12. echo "<a href=\"<? echo '$dirPath.$rows['name']'; ?>\" target=\"_blank\" title=\"Poster\"><img src=\"imgs/icons/save.gif\" alt=\"\" border=\"0\" />";
  13.  
  14. ?>
sorry for my coding... ahehehe... im not so great in programming... so please understand in what i mean....
Jul 25 '07 #1
4 1260
pbmods
5,821 Expert 4TB
imarkdesigns, please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.
Jul 25 '07 #2
sorry about that...

anyway... i finally solved the case of this stuff...

here's my result:

[PHP]

<?php

$query = "SELECT * FROM $sched";
//$result = mysql_query($query);
//$rows=mysql_fetch_array($result);

$source = $rows['name'];

$dirPath = "picture/";
$mainPath = $dirPath . $rows['name'];

if(empty($source)) {
// Result 0
echo "The $source not exist";
}else{
// Result 1
echo "The <a href=\"$mainPath\"> $source </a>exist";
}

?>

[/PHP]
Jul 26 '07 #3
pbmods
5,821 Expert 4TB
Heya, imarkdesigns.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Jul 26 '07 #4
Heya, imarkdesigns.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
:) greetings...

thanks pbmods... since developing isn't my line.. but i am now taking the path for web development... haha... and im enjoy developing site now!

iMark Designs
Jul 26 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: RootShell | last post by:
Hello I need to have a way to check if the user as refreshed the current page. Is there any way in PHP to do this? Here's the full facts, I have a JavaScript running that is merely a 30...
4
by: Michael Albanese | last post by:
I am trying to build a user control that will allow a user to select a date from a calendar. I have to code that will run on the calendar's SelectionChanged event, but i am at a loss to return the...
19
by: Rodger | last post by:
Hi all, I am getting the following error. ***************************** Microsoft JET Database Engine error '80004005' 'O:\DATA\DSR\DSR_DATA.MDB' is not a valid path. Make sure that the...
3
by: Jonck van der Kogel | last post by:
Hi everybody, I am having a hard time finding any info on this subject, so I was hoping maybe one of you could give me some pointers. I am writing an application in Java that uses Connector/J to...
2
by: david | last post by:
Hi, I have asp pages running from a MySQL database. I have placed a path in the required field (although not quite sure on the correct format). My asp page is just displaying the text path...
2
by: Hayato Iriumi | last post by:
Hello, I'm trying to find out a way to detect whether a path passed resides locally or on a remote machine. I can easily detect a path like \\machinename\path to be remote. But when it comes to...
2
by: Simon Harvey | last post by:
Hi all, Is there any easy way to check a field for calues that have changed on a post back. So the page is sent to the user, the user changes some values and I need to know which ones...
3
by: AdamM | last post by:
How can an app detect whether its running under debug or release mode and update file paths automatically? I have several hardcoded paths like "c:\app\bin\debug" currently and want to make it more...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.