473,785 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

detecting path from Mysql

imarkdesigns
46 New Member
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 1276
pbmods
5,821 Recognized Expert Expert
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
imarkdesigns
46 New Member
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($qu ery);
//$rows=mysql_fet ch_array($resul t);

$source = $rows['name'];

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

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

?>

[/PHP]
Jul 26 '07 #3
pbmods
5,821 Recognized Expert Expert
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
imarkdesigns
46 New Member
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
9148
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 seconds countdown, so that the user has only 30 seconds to answer a question.
4
2190
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 data to the correct text box. The question is...How do I detect the Form Name programatically from a user control that is included on a page. i.e. - me.formname....? Thanks in advance for any help.
19
8448
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 path name is spelled correctly and that you are connected to the server on which the file resides.
3
2419
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 interface with a MySQL database with InnoDB tables. When user #1 opens a certain recordset I am locking this recordset in share mode. Therefore if user #2 selects the same recordset (and thus placing a lock as well) user #1 will not be able to...
2
2278
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 instead of the image. I'm using response.write. The Folder is called : images
2
4514
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 a mapped path, I don't really know what to do about it. Does anyone have any idea how to do this?
2
1406
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 changed. Is the only way to do this to go through all the fields and check them against their old values. In which case, would I need to store the values in
3
2164
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 robust. Thanks! Adam
11
26641
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 and PEAR is in c:\wamp\php\pear I modified php.ini in the c:\wamp\php directory to reflect the actual path, but even stopping and restarting my server shows the c: \php5\pear path. I can't change it no matter what I do I also tried the...
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9483
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10346
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10096
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.